nagelkerkeR2 | R Documentation |
Estimate Nagelkerke's R squared from the result of glm(). Evaluate the goodness of fit for logistic regression.
nagelkerkeR2(x)
x |
An object of class 'glm'. |
Rsquare Nagelkerke's R squared.
set.seed(7388)
n <- 300
x <- rnorm(n)
a <- 1
b <- -2
p <- 1/(1+exp(a+b*x))
y <- factor(ifelse(runif(n) < p, 1, 0), levels = 0:1)
mod1 <- glm(y ~ x, family=binomial)
nagelkerkeR2(mod1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.