View source: R/predict-methods.R
predict.logreg_screenr | R Documentation |
predict.logreg_screenr
computes predicted probabilities
of positive test results from new data.
## S3 method for class 'logreg_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 `stats::predict.glm`
.
predict.logreg_screenr
returns (invisibly) a dataframe
augmenting newdata
with the predicted probabilities of positive test
results phat
.
attach(uniobj2)
## 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, 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(uniobj2, newdata = new_corns))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.