View source: R/predict.pqrBayes.R
predict_pqrBayes | R Documentation |
Make predictions from a pqrBayes object
predict_pqrBayes(object, g.new, u.new, e.new, y.new, quant, model, ...)
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 |
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.
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. |
pqrBayes
## 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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.