powered by
Produces the count pseudo r-squared measure for models with a binary outcome.
countRSquare( fit, digits = 3, suppressWarnings = TRUE, plotit = FALSE, jitter = FALSE, pch = 1, ... )
A list including a description of the submitted model, a data frame with the pseudo r-squared results, and a confusion matrix of the results.
The fitted model object for which to determine pseudo r-squared. glm and glmmTMB are supported. Others may work as well.
glm
glmmTMB
The number of digits in the outputted values.
If TRUE, suppresses warning messages.
TRUE
If TRUE, produces a simple plot of actual vs. predicted values.
If TRUE, jitters the "actual" values in the plot.
Passed to plot.
plot
Additional arguments.
Salvatore Mangiafico, mangiafico@njaes.rutgers.edu
The count pseudo r-squared is simply the number of correctly predicted observations divided the total number of observations.
This version is appropriate for models with a binary outcome.
The adjusted value deducts the count of the most frequent outcome from both the numerator and the denominator.
The function makes no provisions for NA values. It is recommended that NA values be removed before the determination of the model.
NA
https://stats.oarc.ucla.edu/other/mult-pkg/faq/general/faq-what-are-pseudo-r-squareds/, https://rcompanion.org/handbook/H_08.html, https://rcompanion.org/rcompanion/e_06.html
nagelkerke, accuracy
nagelkerke
accuracy
data(AndersonBias) model = glm(Result ~ County + Gender + County:Gender, weight = Count, data = AndersonBias, family = binomial(link="logit")) countRSquare(model)
Run the code above in your browser using DataLab