oneWald: Wald Test for One-Inflation

View source: R/oneWald.R

oneWaldR Documentation

Wald Test for One-Inflation

Description

Performs a Wald test to evaluate the significance of the one-inflation parameters in a model estimated using oneinfl.

Usage

oneWald(model)

Arguments

model

A model object of class "oneinflmodel" estimated using oneinfl. The model must include one-inflation parameters (gamma) and a variance-covariance matrix (vc).

Details

The Wald test evaluates the null hypothesis that all one-inflation parameters (gamma) are equal to zero, indicating no one-inflation. The test statistic is calculated as:

W = \gamma^\top V^{-1} \gamma

where \gamma is the vector of one-inflation parameters and V is their variance-covariance matrix. The p-value is computed using a chi-squared distribution with degrees of freedom equal to the length of \gamma.

This test is commonly used to determine whether a one-inflated model provides a significantly better fit than a non-one-inflated counterpart.

Value

A list with the following components:

W

The Wald test statistic.

pval

The p-value associated with the test statistic, based on a chi-squared distribution.

See Also

oneinfl for fitting one-inflated models. oneLRT for a likelihood ratio test of nested models. pchisq for the chi-squared distribution.

Examples

# Example usage
df <- data.frame(y = rpois(100, lambda = 5), x = rnorm(100), z = rnorm(100))
OIZTNB <- oneinfl(y ~ x | z, df = df, dist = "negbin")
oneWald(OIZTNB)


oneinfl documentation built on April 4, 2025, 12:05 a.m.