2

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!

Ben Bolker
  • 211,554
  • 25
  • 370
  • 453
  • Is this a statistical question or a programming question? – shadowtalker Oct 06 '14 at 21:13
  • Is this relevant? http://stats.stackexchange.com/questions/64535/structuring-a-linear-mixed-model-in-r-with-nesting – James Owers Oct 06 '14 at 22:08
  • @Clarishnish have you found a solution? I have a mixed crossed design (2 repeated and 2 independent predictors) and I need to use the lm function because the data is heteroscedastic (-> sandwhich and lmtest packages seem great, but they only work with lm objects not lme which is again great for mixed modelling) – Simone Jan 27 '18 at 19:22
  • @shadowtalker my problem is purely programming. – Simone Jan 27 '18 at 19:23

0 Answers0