Two fixed factors nested and crossed factors in R

2019-07-21 10:53发布

I want to design a nested model. It is kind of difficult to explain so I drew a picture.

enter image description here

All of the factors are fixed and there are 2 levels (0, 1) in each of them. A and B have nested factors C and D. E and F are independent with these guys and are crossed all over. I would like to know the interactions between them.

I know that I can do this in R, for one nested factor:

    out <- lm(Y ~ A + A/B)

But how can I do it when there are several nested factors, and there are other independent factors? Thank you very much!

0条回答
登录 后发表回答