predict.easy_tool: An S3 Method to Compute Simplified Screening Scores

View source: R/predict-methods.R

predict.easy_toolR Documentation

An S3 Method to Compute Simplified Screening Scores

Description

predict.easy_tool computes predicted simplified screening scores from new data.

Usage

## S3 method for class 'easy_tool'
predict(object = NULL, ..., newdata = NULL)

Arguments

object

an object of class easy_tool produced by `easy_tool`.

...

optional arguments to predict methods.

newdata

new dataframe from which predicted simplified screening scores are desired. The dataframe must contain values of the same response variables and covariates that were used to obtain object.

Value

predict.easy_tool returns (invisibly) a dataframe augmenting newdata with the predicted simplified test screening scores score.

Examples

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), Q4 = c(0, 0), Q5 = c(0, 1), Q6 = c(0, 1 ),
                        Q7 = c(0, 1))
attach(uniobj1)
et <- easy_tool(uniobj1, max = 3)
print(predict(et, newdata = new_corns))

sgutreuter/screenr documentation built on Nov. 20, 2022, 2:41 a.m.