mc_anova_dispersion: ANOVA tables for dispersion components.

View source: R/mc_anova_dispersion.R

mc_anova_dispersionR Documentation

ANOVA tables for dispersion components.

Description

Performs Wald tests to generate analysis-of-variance tables of the significance for the dispersion components by response variables for model objects produced by mcglm.

Usage

mc_anova_dispersion(object, p_var, names, verbose = TRUE)

Arguments

object

An object of mcglm class.

p_var

A list of indices that indicate how the dispersion parameters are related. Parameters with the same index are tested together.

names

Names to be shown in the table.

verbose

a logical if TRUE print some information about the tests performed. Default verbose = TRUE.

Value

Type III ANOVA table for dispersion components of mcglm objects.

Author(s)

Lineu Alberto Cavazani de Freitas, lineuacf@gmail.com

See Also

mc_anova_I, mc_anova_II and mc_anova_III.

Examples


library(mcglm)
library(Matrix)
library(htmcglm)

data("soya", package = "mcglm")

form.grain <- grain ~ water * pot
form.seed <- seeds ~ water * pot

soya$viablepeasP <- soya$viablepeas / soya$totalpeas
form.peas <- viablepeasP ~ water * pot

Z0 <- mc_id(soya)
Z1 <- mc_mixed(~0 + factor(block), data = soya)

fit_joint <- mcglm(linear_pred = c(form.grain,
                                   form.seed,
                                   form.peas),
                   matrix_pred = list(c(Z0, Z1),
                                      c(Z0, Z1),
                                      c(Z0, Z1)),
                   link = c("identity",
                            "log",
                            "logit"),
                   variance = c("constant",
                                "tweedie",
                                "binomialP"),
                   Ntrial = list(NULL,
                                 NULL,
                                 soya$totalpeas),
                   power_fixed = c(TRUE,TRUE,TRUE),
                   data = soya)

mc_anova_dispersion(fit_joint,
p_var = list(c(0,1), c(0,1), c(0,1)),
names = list(c('tau10', 'tau11'),
             c('tau20', 'tau21'),
             c('tau30', 'tau31')))


htmcglm documentation built on July 21, 2022, 5:10 p.m.