contrastTest {factDesign} | R Documentation |
'contrastTest' performs simultaneous tests of linear contrasts on the parameters estimates from a linear model.
Description
'contrastTest' performs an F test for simultaneous tests of linear contrasts using an appropriately specified lambda matrix and an lm object.
Usage
contrastTest(model, lambda, cVec = NA, p = 0.01)
Arguments
model |
An lm object. |
lambda |
A matrix of coefficients in the appropriate order to be multiplied by the estromated coefficients of the lm object. |
cVec |
A vector of constants for testing that the linear contrasts equal something other than zero. If this is unspecified, it is assumed to be zero. |
p |
The significance level at which to perform the contrast test. |
Value
test |
Returns "REJECT" or "FAIL TO REJECT" based on the result of the test of hypothesis. |
pvalue |
The pvalue from the F test. |
cEst |
The contrast estimate. |
Author(s)
Denise Scholtens
See Also
par2lambda
,lm
Examples
data(estrogen)
ES <- pData(estrogen)[["ES"]]
TIME <- pData(estrogen)[["TIME"]]
fit <- lm(exprs(estrogen)[6,] ~ ES + TIME + ES*TIME)
betaNames <- names(fit[["coef"]])
betas <- list(c("TIME48h","ESP:TIME48h"))
coefs <- list(c(1,1))
lambda <- par2lambda(betaNames,betas,coefs)
contrastTest(fit,lambda)