signifWald | R Documentation |
Performs a Wald test to evaluate the joint significance of a predictor variable in both the rate and one-inflation components of a model.
signifWald(model, varname)
model |
A fitted model object of class |
varname |
A character string specifying the name of the predictor variable to test. |
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.
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.
oneinfl
for fitting one-inflated models.
oneWald
for a general Wald test of one-inflation parameters.
# 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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.