measure_glm_raw | R Documentation |
Obtain measures of model performance for fitted models.
measure_glm_raw(
y,
y.fitted,
family,
dispersion = 1,
classify = FALSE,
classify.rule = 0.5
)
y |
This is an outcome/response vector. |
y.fitted |
This predicted (estimated) response values for GLMs or probabilties of response values for ordinal models from a fitted model or cross-validation. |
family |
A character stating to which family the model belongs. |
dispersion |
A scalar defining the dispersion parameter from a GLM,
or |
classify |
Logical. When |
classify.rule |
A value between 0 and 1. For a given predicted value
from a logistic regression, if the value is above |
When the family is treated as Gaussian, returns deviance, R2,
mean squared error (MSE), and mean absolute error (MAE). Additionally,
when the outcome is binary, returns misclassification, and if
classify = TRUE
, then returns accuracy, sensitivity, specificity,
positive predictive value (PPV), negative predictive value (NPV), Matthews
correlation coefficient (MCC), and F1 score.
A vector.
This function is a modified version of measure.glm
from
BhGLM
, with the modification that measures are no longer rounded,
and classification evaluation is possible for binary outcomes, along with
measures of classification performance.
y <- c(1, 1, 1, 0, 0, 1, 0, 0, 0, 1)
y.fitted <- c(0, 1, 1, 0, 1, 1, 0, 0, 1, 0)
measure_glm_raw(y, y.fitted, family = "binomial", classify = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.