goodGLM: Generalized Hosmer-Lemeshow Test for GLMs Performs a global...

View source: R/goodGLM.R

goodGLMR Documentation

Generalized Hosmer-Lemeshow Test for GLMs Performs a global goodness-of-fit test on objects of class 'glm'. The test is based on a generalization of the Hosmer-Lemeshow test. For more information, see the two papers by Surjanovic, Lockhart, and Loughin (2020) and Surjanovic and Loughin (2021).

Description

Generalized Hosmer-Lemeshow Test for GLMs Performs a global goodness-of-fit test on objects of class 'glm'. The test is based on a generalization of the Hosmer-Lemeshow test. For more information, see the two papers by Surjanovic, Lockhart, and Loughin (2020) and Surjanovic and Loughin (2021).

Usage

goodGLM(mod, groups = 10L, group_mode = "variance", print_warnings = TRUE)

Arguments

mod

GLM object.

groups

Number of groups. Defaults to 10 (as in the original Hosmer-Lemeshow test).

group_mode

Group mode. One of "trials" or "variance", which groups observations so that the number of trials or the variance of the observations is approximately equal in each group. Defaults to "variance".

print_warnings

Boolean. whether to display warnings.

Value

#' Some parts of this code are based on http://www.chrisbilder.com/categorical/Chapter5/AllGOFTests.R by Tom Loughin Modified by Nikola Surjanovic. Previous comment from 'AllGOFTests.R':


nikola-sur/goodGLM documentation built on Feb. 19, 2024, 10:22 a.m.