| Title: | Information Matrix Test for Regression Models |
|---|---|
| Description: | infotest runs an information matrix test for a regression and splits it into three components—tests for heteroskedasticity, skewness, and kurtosis (Cameron & Trivedi, 1990) |
| Authors: | Hasraddin Guliyev [aut, cre] |
| Maintainer: | Hasraddin Guliyev <[email protected]> |
| License: | GPL-3 |
| Version: | 0.1.0 |
| Built: | 2026-05-29 10:54:14 UTC |
| Source: | https://github.com/guliyevh/infotest |
infotest() applies the Information Matrix (IM) test to a fitted
lm model and reports the Cameron & Trivedi (1990) decomposition
into heteroskedasticity, skewness, and kurtosis components. Optionally,
White's (1980) heteroskedasticity test is also reported.
infotest(model, white = TRUE)infotest(model, white = TRUE)
model |
A fitted |
white |
Logical; if |
Information Matrix (IM) Test for lm() Models
The function checks that model is an lm fit and refuses
weighted models. The intercept is removed from the design matrix, regressors
are centered, and quadratic terms are constructed for the auxiliary
regressions used by the IM and White tests. Test statistics are computed as
chi-square values with associated degrees of freedom. A formatted table is
printed to the console; the full results are returned invisibly.
Invisibly returns a list with:
decomposition: a list with components
heteroskedasticity, skewness, kurtosis, and
total, each providing chi2, df, and p.
white: (only when white = TRUE) a list with
chi2, df, and p.
Weighted lm fits are not supported.
If there are no covariates (intercept-only model), the test is skipped with a message.
Hasraddin Guliyev [email protected]
White, H. (1980). A heteroskedasticity-consistent covariance matrix
estimator and a direct test for heteroskedasticity. Econometrica,
48(4), 817–838.
Cameron, A. C., & Trivedi, P. K. (1990). The information matrix test and its
applied alternatives. Econometric Theory, 6(2), 179–195.
m <- lm(Sepal.Length ~ Sepal.Width + Petal.Length, data = iris) infotest(m) infotest(m, white = TRUE) res <- invisible(infotest(m)) str(res$decomposition)m <- lm(Sepal.Length ~ Sepal.Width + Petal.Length, data = iris) infotest(m) infotest(m, white = TRUE) res <- invisible(infotest(m)) str(res$decomposition)