anova.mcglm: Wald Tests for Fixed Effects in mcglm Models

View source: R/mc_S3_methods.R

anova.mcglmR Documentation

Wald Tests for Fixed Effects in mcglm Models

Description

Performs Wald chi-square tests for assessing the significance of fixed-effect terms in the linear predictors of an mcglm model. The tests are conducted separately for each response variable and are particularly useful for joint hypothesis testing of regression coefficients associated with categorical covariates with more than two levels. This function is not intended for model comparison.

Usage

## S3 method for class 'mcglm'
anova(object, ..., verbose = TRUE)

Arguments

object

An object of class mcglm, typically the result of a call to mcglm.

...

Additional arguments. Currently ignored.

verbose

Logical indicating whether the Wald test results should be printed to the console. If FALSE, the function silently returns the results.

Details

The Wald tests are computed using the observed covariance matrix of the regression parameter estimates. For each response variable, joint tests are performed for sets of parameters corresponding to the same model term, as defined by the design matrix.

Value

A list of data frames, one for each response variable. Each data frame contains the results of Wald chi-square tests for the fixed-effect terms in the corresponding linear predictor, with the following columns:

Covariate

Name of the covariate or model term tested.

Chi.Square

Value of the Wald chi-square statistic.

Df

Degrees of freedom associated with the test.

p.value

P-value of the Wald test.

The returned object is invisible and is primarily intended for programmatic use.

Author(s)

Wagner Hugo Bonat, wbonat@ufpr.br

See Also

summary.mcglm, coef.mcglm, vcov.mcglm

Examples

x1 <- seq(-1, 1, length.out = 100)
x2 <- gl(5, 20)
beta <- c(5, 0, -2, -1, 1, 2)
X <- model.matrix(~ x1 + x2)
set.seed(123)
y <- rnorm(100, mean = X %*% beta, sd = 1)
data <- data.frame(y = y, x1 = x1, x2 = x2)
fit <- mcglm(c(y ~ x1 + x2), list(mc_id(data)), data = data)
anova(fit)


mcglm documentation built on Jan. 9, 2026, 1:07 a.m.