Skip to contents

This is the generic function to compute the likelihood ratio statistics and p-valus for binary regression models.

Usage

lrt_glm(object, param)

Arguments

object

A list with at least two elements from the class glm. The function does not check whether the models are nested.

param

A named vector with elements sigma_s and lambda_s which can be outputs from the adjust_glm function.

Value

A list with two elements

models

Model formula

anova.tab

Significance tables for the LRT

Details

Under the null hypothesis: $$ H_0:\quad \beta_1 = \ldots = \beta_k = 0, $$ two times the likelihood ratio statistics \(\Lambda\) is asymptotically from a re-scaled chi-squared distribution with \(k\) degrees of freedom $$ 2 \Lambda \stackrel{d}{\longrightarrow} \frac{\kappa \sigma_\star^2}{\lambda_\star}\chi^2_k $$ where \((\sigma_\star, \lambda_\star)\) can be computed using find_param function.

References

The likelihood ratio test in high-dimensional logistic regression is asymptotically a rescaled Chi-square, Pragya Sur, Yuxin Chen and Emmanuel Candes, Probab. Theory Relat. Fields 175, 487–558 (2019).

Examples

if (FALSE) {
n <- 1000L
p <- 300L
X <- matrix(rnorm(n*p, 0, 1), n, p) / sqrt(p)
beta <- rep(c(0, 1), each = p / 2)
Y <- rbinom(n, 1, 1 / (1 + exp(- X %*% beta)))
f1 <- glm(Y ~ X + 0, family = binomial, x = TRUE, y = TRUE)
f2 <- glm(Y ~ X[ , -1] + 0, family = binomial, x = TRUE, y = TRUE)
adjusted_fit <- adjust_glm(f1)
lrt_glm(list(f1, f2), adjusted_fit$param)
}