signifWald: Wald Test for Significance of a Predictor Variable

View source: R/signifWald.R

signifWaldR Documentation

Wald Test for Significance of a Predictor Variable

Description

Performs a Wald test to evaluate the joint significance of a predictor variable in both the rate and one-inflation components of a model.

Usage

signifWald(model, varname)

Arguments

model

A fitted model object of class "oneinflmodel".

varname

A character string specifying the name of the predictor variable to test.

Details

This function tests the null hypothesis that the coefficients for the specified predictor variable are jointly equal to zero in both the rate (beta) and one-inflation (gamma) components of the model. The test statistic is calculated as:

W = \mathbf{c}^\top V^{-1} \mathbf{c}

where \mathbf{c} is the vector of coefficients for the predictor in the rate and one-inflation components, and V is their variance-covariance matrix. The p-value is computed using a chi-squared distribution with 2 degrees of freedom.

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 with 2 degrees of freedom.

See Also

oneinfl for fitting one-inflated models. oneWald for a general Wald test of one-inflation parameters.

Examples

# Example usage
set.seed(123)
df <- data.frame(x = rnorm(100), z = rnorm(100), y = rpois(100, lambda = 5))
model <- oneinfl(y ~ x | z, df = df, dist = "Poisson")
result <- signifWald(model, varname = "x")
print(result$W)    # Wald test statistic
print(result$pval) # p-value


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