iacontrast: Generating labelled product type interaction matrix

Description Usage Arguments Details Value Author(s) References Examples

Description

Function to create a product type interaction contrast matrix from two one-way contrast matrices according to Gabriel et al. The two one-way contrast matrices are constructed from a prespecified set of contrast or from user defined contrast matrices.

Usage

1
2
3
4
iacontrast(fa, fb, typea = "Dunnett", typeb = "Dunnett", 
           cma = NULL, cmb = NULL, droplevels = TRUE, 
           abbrevnames = NULL, orderby = NULL, 
           sep = " - ", cw = ",", cb = ":", method = "at")

Arguments

fa

factor variable for the first factor (A) with at least two levels

fb

factor variable for the second factor (B) with at least two levels

typea

character string, one of those as described for type in contrMat (multcomp), ignored if cma is given. If provided, typea is ignored.

typeb

character string, one of those as described for type in contrMat (multcomp), ignored if cmb is given. If provided, typeb is ignored.

cma

contrast matrix, with as many columns as there are levels in fa (before or after dropping unused levels, see droplevels below).

cmb

contrast matrix, with as many columns as there are levels in fb (before or after dropping unused levels, see droplevels below).

droplevels

logical, indicating whether unused levels of the input factors fa, fb should be dropped. If TRUE, the number of columns in cma, cmb, should fit the number of used levels. If FALSE, the number of columns in cma, cmb shoudl fit the number of level in the leve?l attribute of the factors.

abbrevnames

a named list of arguments to be passed to abbreviate the factor level names for the construction of names for the interaction contrasts

orderby

CURRENTLY NOT USED a,b, whether the output contrasts should be additionally ordered according to factor a, b

sep

character string to be used to separate different levels of the cellmeans in comparisons in the contrasts names

cw

character string, to be used when collapsing original factor levels within a factor (pooling contrasts)

cb

character string, to be used when collapsing original factor levels to cellmean levels in the contrasts names

method

a character string specifying the lebelling of contrasts, must be one of "at" (default) or "cellmeans" .

Details

Generates a labelled product type interaction contrast matrix from two one way contrast matrices. The user can either use select from a set of prespecified contrast in the function contrMat from the package multcomp.

Value

a list with two elements:

fab

the cellmeans factor (with one level for each level combination of fa, fb)

cmab

interaction contrast matrix, with columns and naming of contrast fitting the level order in fab.

Author(s)

Frank Schaarschmidt, Andreas Kitsche

References

K. R. Gabriel, J. Putter, and Y. Wax. Simultaneous Confidence Intervals for product-type Interaction Contrasts. Journal of the Royal Statistical Society Series B - Statistical Methodology, 35(2): 234-244, 1973.

A. Kitsche, F. Schaarschmidt. Analysis of statistical interactions in factorial experiments. Journal of Agronomy and Crop Science, 2014

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
fa<-factor(rep(rep(LETTERS[1:5], rep(3,5)), each=3))
fb<-factor(rep(rep(c(1,2,3), rep(3,3)), times=5))

iacontrast(fa=fa, fb=fb, typea="Dunnett", typeb="Tukey")
iacontrast(fa=fa, fb=fb, typea="Dunnett", typeb="Tukey", method="c")


cmbp<-rbind(c(1,0,0),
            c(0,0.5,0.5))
            
iacontrast(fa=fa, fb=fb, typea="Dunnett", cmb=cmbp)
iacontrast(fa=fa, fb=fb, typea="Dunnett", cmb=cmbp, method="c")

cmap<-rbind(c(1,1,1,0,0)/3,
            c(0,0,0,1,1)/2)
            
iacontrast(fa=fa, fb=fb, cma=cmap, typeb="Tukey")
iacontrast(fa=fa, fb=fb, cma=cmap, typeb="Tukey", method="c")

AKitsche/statint documentation built on May 5, 2019, 11:30 a.m.