I've got a dataset with 3 factor variables with only one interaction. Y is the response and A,B,C are the independent variables. Variable B in particular has a factor that occurs with no other factors, so the design matrix has a 0 in it, leading to an error when trying to run a mixed model (fixed factors only).

I'm trying to figure out how to reduce number of variables so the design matrix doesn't have a 0 in it.

In the case where all variables and all possible interactions are included, this is fairly straightforward, as I can create one new variable with all possible factor values for A,B,C. I've tested this in R and get equivalent values with: Y ~ A * B * C (which expands to Y ~ A + B + C + A:B + A:C + B:C + A:B:C) provides the same output as Y ~ D when A,B,C are put together in a new variable D. Basically I'm reducing it to a one way design.

Idea taken from here – Can you convert three-way ANOVA to one-way ANOVA?

However, what I need to do is only explore two interactions, not all of them. The formula I'm trying to use is Y ~ A + B + C + A:B + A:C.

Can anybody recommend how to reduce this to fewer factor variables so I don't end up with a 0 in the design matrix? I've been trying a lot of combinations but am mentally not able to wrap my head around this.



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.