Learn R Programming

lmreg (version 1.2)

multcomp: Multiple comparison tests

Description

Produces p-values of Bonferroni and Scheffe multiple comparison tests of several testable linear hypotheses.

Usage

multcomp(y, X, A, xi, tol=sqrt(.Machine$double.eps))

Arguments

y

Responese vector in linear model.

X

Design/model matrix or matrix containing values of explanatory variables (generally including intercept).

A

Coefficient matrix (A.beta=xi is the set of multiple hypotheses that has to be tested).

xi

A vector of values (A.beta=xi is the set of multiple hypotheses that has to be tested).

tol

A relative tolerance to detect zero singular values while computing generalized inverse, in case X is rank deficient (default = sqrt(.Machine$double.eps)).

Value

Returns F statistics and p-values of Bonferroni and Scheffe multiple comparison tests of the set of linear hypotheses. A set of five vectors:

A

Specified coefficient matrix.

xi

Specified values of A.beta.

Fstat

Set of F-ratios for each hypothesis.

Bonferroni.p

Set of Bonferroni p-values for different hypotheses.

Scheffe.p

Set of Scheffe p-values for different hypotheses.

Details

Normal distribution of response (given explanatory variables and/or factors) is assumed.

References

Sengupta and Jammalamadaka (2019), Linear Models and Regression with R: An Integrated Approach.

Examples

Run this code
# NOT RUN {
data(denim)
attach(denim)
X <- cbind(1,binaries(Denim),binaries(Laundry))
A <- rbind(c(0,1,-1,0,0,0,0),c(0,1,0,-1,0,0,0),c(0,0,1,-1,0,0,0))
xi <- c(0,0,0)
multcomp(Abrasion, X, A, xi, tol=1e-14)
detach(denim)
# }

Run the code above in your browser using DataLab