Skip to main content
replaced http://stats.stackexchange.com/ with https://stats.stackexchange.com/
Source Link

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?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.

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.

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.

punctuation, capitalization, code formatting
Source Link
Nick Stauner
  • 12.4k
  • 5
  • 53
  • 110

How to with Convertconvert 3 Factor Variablesfactor variables to fewer Variablesvariables for gls() in R

I've got a dataset with 3 factor variables with only one interaction. YY is the response and AA,BB,CC are the independent variables. Variable BB in particular has a factor that occurs with no other factors, so the Design Matrixdesign matrix has a 0 in it, leading to aan 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 Matrixmatrix doesn't have a 0 in it.

In the case where all variables and all possible interactions are included, this is fairly straight forwardstraightforward, as I can create one new variable with all possible factor values for AA,BB,CC. I've tested this in R and get equivalent values with

Y ~ A * B * C: Y ~ A * B * C (which expands to Y ~ A + B + C + A:B + A:C + B:C + A:B:CY ~ A + B + C + A:B + A:C + B:C + A:B:C) provides the same output as Y ~ DY ~ D when AA,BB,CC are put together in a new variable DD. 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:CY ~ 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.

How to with Convert 3 Factor Variables to fewer Variables for gls() in R

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 a 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 straight forward 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.

How to convert 3 factor variables to fewer variables for gls() in R

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.

edited title
Link
obug
  • 111
  • 3

How to with Convert 3 Factors VariableFactor Variables to fewer Variables for gls() in R

Source Link
obug
  • 111
  • 3
Loading