View source: R/r_squared_for_glm.R
r_squared_for_glm | R Documentation |
R squared for glm
r_squared_for_glm(obj)
obj |
glm object |
R squared for glm is defined as 1 - (D_M / D_0) where D_M and D_0 is the deviance for respectively the chosen model and the null model
R squared for glm (numeric value)
set.seed(1) df <- data.frame(x = 1:100, eps = rnorm(n = 100)) df$y <- floor(exp(df$x + df$eps)) m <- glm(y ~ x, data = df, family = poisson()) r_squared_for_glm(obj = m)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.