predict_pqrBayes {pqrBayes} | R Documentation |
Make predictions from a pqrBayes object
Description
Make predictions from a pqrBayes object
Usage
predict_pqrBayes(object, g.new, u.new, e.new, y.new, quant, model, ...)
Arguments
object |
a pqrBayes object. |
g.new |
a matrix of new predictors (e.g. genetic factors) at which predictions are to be made. When being applied to the linear model (i.e., LASSO), binary LASSO or group LASSO, g.new = g. |
u.new |
a vector of new environmental factor at which predictions are to be made. When being applied to the linear model (i.e., LASSO), binary LASSO or group LASSO, u.new = NULL. |
e.new |
a vector or matrix of new clinical covariates at which predictions are to be made. When being applied to the linear model (i.e., LASSO), e.new = e. |
y.new |
a vector of the response of new observations. When being applied to the linear model (i.e., LASSO), binary LASSO or group LASSO, y.new = y. |
quant |
the quantile level. The default is 0.5. |
model |
the model to be fitted. The default is "VC" for a quantile varying coefficient model. Users can also specify "linear" for a linear model (i.e., LASSO), "binary" for binary LASSO and "group" for a group LASSO. |
... |
other predict arguments |
Details
g.new (u.new) must have the same number of columns as g (u) used for fitting the model. By default, the clinical covariates are NULL unless provided. The predictions are made based on the posterior estimates of coefficients in the pqrBayes object.
Value
an object of class ‘pqrBayes.pred’ is returned, which is a list with components:
error |
prediction error. |
y.pred |
predicted values of the new observations. |
See Also
Examples
## The quantile regression model
data(data)
data = data$data_linear
g=data$g
y=data$y
e=data$e
fit1=pqrBayes(g,y,u=NULL,e,d = NULL,quant=0.5,spline=NULL,model="linear")
prediction=predict_pqrBayes(fit1,g,u.new=NULL,e.new = e, y.new = y,model="linear")