SamplePred {bkmr}R Documentation

Obtain posterior samples of predictions at new points

Description

Obtains posterior samples of E(Y) = h(Znew) + beta*Xnew or of g^{-1}[E(y)]

Usage

SamplePred(fit, Znew = NULL, Xnew = NULL, Z = NULL, X = NULL,
  y = NULL, sel = NULL, type = c("link", "response"), ...)

Arguments

fit

An object containing the results returned by a the kmbayes function

Znew

optional matrix of new predictor values at which to predict new h, where each row represents a new observation. If not specified, defaults to using observed Z values

Xnew

optional matrix of new covariate values at which to obtain predictions. If not specified, defaults to using observed X values

Z

an n-by-M matrix of predictor variables to be included in the h function. Each row represents an observation and each column represents an predictor.

X

an n-by-K matrix of covariate data where each row represents an observation and each column represents a covariate. Should not contain an intercept column.

y

a vector of outcome data of length n.

sel

A vector selecting which iterations of the BKMR fit should be retained for inference. If not specified, will default to keeping every 10 iterations after dropping the first 50% of samples, or if this results in fewer than 100 iterations, than 100 iterations are kept

type

whether to make predictions on the scale of the link or of the response; only relevant for the binomial outcome family

...

other arguments; not currently used

Details

For guided examples, go to https://jenfb.github.io/bkmr/overview.html


[Package bkmr version 0.2.0 Index]