lrt_glm | R Documentation |
This is the generic function to compute the likelihood ratio statistics and p-valus for binary regression models.
lrt_glm(object, param)
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 |
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.
A list with two elements
Model formula
Significance tables for the LRT
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).
## Not run:
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)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.