predict.BVCfit: make predictions from a BVCfit object

Description Usage Arguments Details Value See Also Examples

Description

make predictions from a BVCfit object

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## S3 method for class 'BVCfit'
predict(object, X.new, Z.new, E.new = NULL,
  clin.new = NULL, Y.new = NULL, ...)

## S3 method for class 'VarLin'
predict(object, X.new, Z.new, E.new, clin.new = NULL,
  Y.new = NULL, ...)

## S3 method for class 'VarOnly'
predict(object, X.new, Z.new, clin.new = NULL,
  Y.new = NULL, ...)

## S3 method for class 'LinOnly'
predict(object, X.new, Z.new, E.new = NULL,
  clin.new = NULL, Y.new = NULL, ...)

Arguments

object

BVCfit object.

X.new

a matrix of new values for X at which predictions are to be made.

Z.new

a vector of new values for Z at which predictions are to be made.

E.new

a vector of new values for E at which predictions are to be made.

clin.new

a vector or matrix of new values for clin at which predictions are to be made.

Y.new

a vector of the response of new observations. If provided, the prediction mean squared error (PMSE) will be computed based on Y.new.

...

other predict arguments

Details

X.new (clin.new) must have the same number of columns as X (clin) used for fitting the model. If E and clin are provided when fit the model, E.new and clin.new must not be NULL, and vice versa. The predictions are made based on the posterior estimates of coefficients in the BVCfit object. Note that the main effects of environmental exposures Z and E are not subject to selection.

Value

an object of class "BVCfit.pred" is returned, which is a list with components:

pmse

predictions mean squared error. pmse is NULL is Y.new=NULL.

y.pred

predicted values of the new observations.

See Also

BVCfit

Examples

1
2
3
4
5
6
7
8
data(gExp)
spbayes=BVCfit(X, Y, Z, E, clin)
spbayes

data(gExp.new)
pred = predict(spbayes, X.new, Z.new, E.new, clin.new, Y.new)
pred$pmse
# pred$y.pred

spinBayes documentation built on June 6, 2019, 5:02 p.m.