| predict.risk_mod | R Documentation |
Obtains predictions from risk score models.
## S3 method for class 'risk_mod'
predict(
object,
newx = NULL,
type = c("link", "response", "score"),
target_prevalence = NULL,
study_prevalence = NULL,
...
)
object |
An object of class "risk_mod", usually a result of a call to
|
newx |
Optional matrix of new values for |
type |
The type of prediction required. The default ("link") is on the scale of the predictors (i.e. log-odds); the "response" type is on the scale of the response variable (i.e. risk probabilities); the "score" type returns the risk score calculated from the integer model. |
target_prevalence |
Optional numeric scalar. If provided (and
|
study_prevalence |
Optional numeric scalar giving the outcome
prevalence in the sample used to fit |
... |
Additional arguments. |
Numeric vector of predicted values.
y <- breastcancer[[1]]
X <- as.matrix(breastcancer[,2:ncol(breastcancer)])
mod <- risk_mod(X, y, lambda0 = 0.01)
predict(mod, type = "link")[1]
predict(mod, type = "response")[1]
predict(mod, type = "score")[1]
predict(mod, type = "response", target_prevalence = 0.10)[1]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.