Description Usage Arguments Details Value Author(s) Examples
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.
1 | getModelCutoffs(pred, obs, div=10)
|
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 |
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).
This function returns a table containing the following statistics:
TP - the number of true negatives
FP - the number of false positives
FN - the number of false negatives
TN - the number of true positives
sensitivity
specificity
PPV - positive predictive value
NVP - negative predictive value
accuracy
error
prevalence
lift
precision (same as PPV)
recall (same as sensitivity)
F1_score (harmonic mean of precision and recall)
Tomas Karpati M.D.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.