I have two factors and what to test the null hypothesis that each term is
equal to 0 (which in this case is meaningful). With one factor you just add
-1 to remove the intercept. However, with two factors I don't understand the
summary output. I'm obviously missing something re contrasts.  An answer to
my question below would be much appreciated. Thanks in advance.

 

# create dummy data

fac1 <- rep(gl(2, 6, labels = c("A", "B")), 4 )

fac2 <- rep(gl(2, 3, labels = c("X", "Y") ), 8 )

block <- gl(4, 12)

resp <- rnorm(length(fac1), mean = 10)

dummy <- data.frame(resp, fac1, fac2, block)

 

# load nlme

library(nlme)

 

# create lme model

# no intercept, only fac1

mod1 <- lme(resp ~ fac1 - 1, random = ~ 1 | block, data = dummy)

summary(mod1)

# here the null hypotheses being tested are that the terms for fac1A and
fac1B are both = 0

# this is what I want

 

# but what about when there is another factor?

# what are the null hypotheses with the terms, particularly fac2Y, and why
is fac2X not listed?

mod2 <- lme(resp ~ fac1 + fac2 - 1, random = ~ 1 | block, data = dummy)

summary(mod2)

 

Regards

Etienne

 

 


	[[alternative HTML version deleted]]


