mc_multcomp: Multiple comparisons test for each response.

View source: R/mc_multcomp.R

mc_multcompR Documentation

Multiple comparisons test for each response.

Description

Performs a multiple comparisons test to compare diferences between treatment levels for each response for model objects produced by mcglm.

Usage

mc_multcomp(object, effect, data, verbose = TRUE)

Arguments

object

An object of mcglm class.

effect

A list of vector of variables. For each configuration of these the estimate will be calculated.

data

Data frame with the dataset used in the model.

verbose

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

Value

Table of multiple comparisons.

Author(s)

Lineu Alberto Cavazani de Freitas, lineuacf@gmail.com

See Also

mc_mult_multcomp.

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_multcomp(object = fit_joint,
            effect = list(c('water'),
                          c('water'),
                          c('water')),
            data = soya)

mc_multcomp(object = fit_joint,
            effect = list(c('pot'),
                          c('pot'),
                          c('pot')),
            data = soya)


mc_multcomp(object = fit_joint,
            effect = list(c('water', 'pot'),
                          c('water', 'pot'),
                          c('water', 'pot')),
            data = soya)


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