predict.roben {roben} | R Documentation |
make predictions from a roben object
Description
make predictions from a roben object
Usage
## S3 method for class 'roben'
predict(object, X.new, E.new, clin.new = NULL, Y.new = NULL, ...)
Arguments
object |
roben object. |
X.new |
a matrix of new values for X 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 error will be computed based on Y.new. |
... |
other predict arguments |
Details
X.new (E.new) must have the same number of columns as X (E) used for fitting the model. If clin was provided when fit the model, clin.new must not be NULL, and vice versa. The predictions are made based on the posterior estimates of coefficients in the roben object. Note that the main effects of environmental exposures E are not subject to selection.
If Y.new is provided, the prediction error will be computed. For robust methods, the prediction mean absolute deviations (PMAD) will be computed. For non-robust methods, the prediction mean squared error (PMSE) will be computed.
Value
an object of class ‘roben.pred’ is returned, which is a list with components:
error |
prediction error. error is NULL is Y.new=NULL. |
y.pred |
predicted values of the new observations. |
See Also
Examples
data(GxE_small)
test=sample((1:nrow(X)), floor(nrow(X)/5))
fit=roben(X[-test,], Y[-test,], E[-test,], clin[-test,], iterations=5000)
predict(fit, X[test,], E[test,], clin[test,], Y[test,])