MyNixOS website logo
Description

Information Matrix Test for Regression Models.

Implements the Information Matrix test for regression models following Cameron, A. C., & Trivedi, P. K. (1990) <https://cameron.econ.ucdavis.edu/research/imtest_impliedalternatives_ucdwp372.pdf> Decomposes the test into components for heteroscedasticity, skewness, and kurtosis to diagnose specific forms of misspecification. Provides both overall and component-wise statistics for model assessment.

infotest

The goal of infotest is to implement the Cameron & Trivedi (1990) Information Matrix test for regression models, decomposing it into tests of heteroskedasticity, skewness, and kurtosis.

Installation

You can install the development version of infotest like so:

install.packages("pak")
pak::pkg_install("guliyevh/infotest")

Example

This is a basic example which shows you how to solve a common problem:

library(infotest)

# Fit a simple linear model
model <- lm(Sepal.Length ~ Sepal.Width + Petal.Length, data = iris)

# Run the Cameron & Trivedi (1990) IM test decomposition
infotest(model)

White's (1980) heteroskedasticity test
H0: Homoskedasticity
Ha: Unrestricted heteroskedasticity

chi2(5) = 16.3799
Prob > chi2 = 0.0058

Cameron & Trivedi's (1990) decomposition of IM-test

----------------------------------------
Source                     chi2     df          p
----------------------------------------
Heteroskedasticity        16.38      5     0.0058
Skewness                   0.15      2     0.9273
Kurtosis                   0.49      1     0.4834
Joint Test                17.02      8     0.0299
----------------------------------------


# Without White's (1980) heteroskedasticity test
infotest(model, white = FALSE)

Cameron & Trivedi's (1990) decomposition of IM-test

----------------------------------------
Source                     chi2     df          p
----------------------------------------
Heteroskedasticity        16.38      5     0.0058
Skewness                   0.15      2     0.9273
Kurtosis                   0.49      1     0.4834
Joint Test                17.02      8     0.0299
----------------------------------------

References

Cameron, A. C., & Trivedi, P. K. (1990). The information matrix test and its applied alternatives. Econometric Theory, 6(2), 179–195.

White, H. (1980). A heteroskedasticity-consistent covariance matrix estimator and a direct test for heteroskedasticity. Econometrica, 48(4), 817–838.

Citation

If you use this package, please cite:

Hasraddin Guliyev (2025). infotest: Information Matrix Test for Regression Models. R package version 0.1.0.

Metadata

Version

0.1.0

License

Unknown

Platforms (76)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-linux
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows