Package 'infotest'

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

Help Index


Information Matrix Test for Regression Models

Description

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.

Usage

infotest(model, white = TRUE)

Arguments

model

A fitted lm object.

white

Logical; if TRUE, also compute and report White's test (default TRUE).

Details

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.

Value

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.

Warnings

  • Weighted lm fits are not supported.

  • If there are no covariates (intercept-only model), the test is skipped with a message.

Author(s)

Hasraddin Guliyev [email protected]

References

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.

See Also

lm, pchisq

Examples

m <- lm(Sepal.Length ~ Sepal.Width + Petal.Length, data = iris)
infotest(m)
infotest(m, white = TRUE)
res <- invisible(infotest(m))
str(res$decomposition)