View source: R/predict-methods.R
predict.lasso_screenr | R Documentation |
predict.lasso_screenr
computes predicted probabilities of
positive test results from new data.
## S3 method for class 'lasso_screenr'
predict(object = NULL, ..., newdata = NULL)
object |
an object of class |
... |
optional arguments to |
newdata |
new dataframe from which predicted probabilities of positive
test results are desired. The dataframe must contain values of the same
response variables and covariates that were used to obtain |
This method is a convenience wrapper for
`glmpath::predict.glmpath`
.
predict.lasso_screenr
returns (invisibly) a dataframe
augmenting the complete cases in newdata
with the predicted
probabilities of positive test results phat_minAIC
and
phat_minBIC
from the models that produced the minimum AIC and BIC,
respectively.
attach(uniobj1)
## Get some new observations
new_corns <- data.frame(ID = c("Alice D.", "Bernie P."),
testresult = c(NA, NA),
Q1 = c(0, 0), Q2 = c(0, 0), Q3 = c(0, 1), Q4 = c(0, 0),
Q5 = c(0, 1), Q6 = c(0, 1), Q7 = c(0, 1))
## Predict the probabilities of testing positive for the new subjects
print(predict(uniobj1, newdata = new_corns))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.