getModelCutoffs: Function for selection of the prediction cutoffs by each...

Description Usage Arguments Details Value Author(s) Examples

View source: R/mechkar.R

Description

This function is intended to calculate the most important statistics that may help in making desicions on the optimal cutoff of the predictions for our needs.

Usage

1
getModelCutoffs(pred, obs, div=10)

Arguments

pred

a vector containing the predicted values of a model

obs

a vector containing the values of the outcome variable

div

the number of quantiles to calculate. Default=10

Details

This function return a list containing nine values (see values section). It includes three types of standards: the European (euro), the American (us) and the World Health Organization (who). The confidence interval (CI) is calculated using the binomial probabilities using the binconf function of the Hmisc package. The default is to calculate the 95% CI (using an alpha of 0.05).

Value

This function returns a table containing the following statistics:

Author(s)

Tomas Karpati M.D.

Examples

1
2
3
mod <- glm(am ~ mpg + cyl + hp + wt, data=mtcars, family="binomial")
pred <- as.numeric(predict(mod, newdata = mtcars, type="response"))
tab2 <- getModelCutoffs(pred,mtcars$am)

mechkar documentation built on March 13, 2020, 2:30 a.m.