cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
Mickyboy
Level V

Variable confounds with residual

Hi,

 

l am attempting to analyse data for an interlab study with a mixed model, its a nested design with 5 variables, the dependant variable is titers, the structure of my analysis is as follows

Fixed Effect

Sample (30 of)

Random Effects

Sample*Lab (3 levels)
Sample*Day (3 Levels)
Sample*Run (2 Levels)
Replicate[Sample,Lab,Day,Run] (replicate has 2 levels)
Sample*Lab*Day

 

l get the error message that Replicate[Sample,Lab,Day,Run] confounds with residual, this is the first time i have encountered this message and i am not sure what its telling me, has anyone encountered this before and how did they overcome it??

 

Thanks

Mick

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Variable confounds with residual

No.

 

Yes, the replicates are correlated, but the correlation is accounted for by the other terms in the model. I would not include explicitly replicate in model. It is implicitly included as the residual variance. The assumption of the usual linear regression model is that the residual variance is independent of the response level. Be sure to carefully perform residual analysis to verify this and other assumptions.

 

In other words, the structure you defined, including the nesting, is correct, but it is unnecessary to include the lowest level of the structure in the terms of the model.

View solution in original post

10 REPLIES 10
Mickyboy
Level V

Re: Variable confounds with residual

Thought l would reply to my own post, i think i have over complicated things, l have retried with a simplified model

Sample  Fixed Effect

Sample*Lab & Random Lab Variance

Run[Sample,Lab,Day] & Random Run Variance

Sample*Lab*Day & Random Interaction between Lab and Day

Sample*Day & Random Day Variance

the R2 is great, no convergence issues, no confounding, and is easy to explain.

Any input would be appreciated

 

Re: Variable confounds with residual

The residual is automatically the lowest random effect. If residual of each observation is actually the same as the replicate level of random effect, then they are confounded. Leave replicate out of the model. The residual estimate is the replicate estimate.

Mickyboy
Level V

Re: Variable confounds with residual

OK, got you

Re: Variable confounds with residual

Are you also including the main random effects of Lab, Run, and Day?

Mickyboy
Level V

Re: Variable confounds with residual

l am Interpreting the interaction of sample*Lab, sample*Day, and Run[Sample,Lab,Day] as my main effects of Lab, Day and Run, so for lab, by including the random slopes and intercept l want to see the devaition for each lab from the average effect of sample, and this i will interepret as my main effect. 

Re: Variable confounds with residual

The deviation of each level from the mean is the simple main effect Sample, Lab, Day, and Run. Not the cross-products with Sample. The interaction terms capture how the effect of one variable depends on the level of another factor. So the term Day represents the average deviation of each day while the Sample*Day term represents how the average deviation of each day depends on the sample.

 

The nesting of levels like Run in Day, for example, might prevent you from estimating interaction effects.

Mickyboy
Level V

Re: Variable confounds with residual

Thanks for your assistance @Mark_Bailey, its greatly appreciated, its interesting, and i guess it depends on the research question l want to answer and "how the average deviation of each day depends on the sample" is one of them, as the samples were sent from the one source so the variance should all be the same (foolish thinking ?) 

The data structure is per the attached excel file, X 3 labs, so the correct syntax for the mixed model to estimate each levels % proportion of variation explained should look like this, all as random effects

Lab

Day[Lab]

Run[Day, Lab]

if i then wanted to include sample to see the % proportion of variation explained by sample l would then include sample as Random effect, drop it as a fixed effect and the syntax would look like this, all as random effects

Sample

Lab
Day[Lab]
Run[Day, Lab]

As sample doesnt fit into the data structure is just a main effect as well as Lab???

This intuitively feels correct to me, but any advice would be appreciated.

 

Thanks very much

 

 

 

Mickyboy
Level V

Re: Variable confounds with residual

l might be overstating the number of levels in the data, if i wished to include the lowest level of data, replicate these would be correlated and the same could be said of run, not so for day therefore

Sample

Lab

Day

Run[Lab, Day]

Replicate[Lab,Day,Run]

So Sample, Lab and Day as main effects makes sense, and due to the clustering in Replicate and Run, they would need to specified as nested??

 

Does this sound right?

 

Re: Variable confounds with residual

No.

 

Yes, the replicates are correlated, but the correlation is accounted for by the other terms in the model. I would not include explicitly replicate in model. It is implicitly included as the residual variance. The assumption of the usual linear regression model is that the residual variance is independent of the response level. Be sure to carefully perform residual analysis to verify this and other assumptions.

 

In other words, the structure you defined, including the nesting, is correct, but it is unnecessary to include the lowest level of the structure in the terms of the model.