Choose Language Hide Translation Bar
Highlighted
joemama985
Community Trekker

Nominal labeling structure impacting results for random effect in mixed model

Background: I had 6 individuals each assigned to either the treatment or control groups (3 per group). I wanted to compare the effect of the treatment and have included the "individual" as a random effect in my mixed model and "treatment" (T or C) as a fixed effects.

 

Issue: I am finding that I get different results based on how I label my replicates (individuals). In the experiment I had the individuals organised as 1,2,3, in the treated group and 4,5,6, in the control group. This was how I was including "individual" in my mixed model originally but I have been since advised that this is incorrect and confounds treatment effects because individuals weren't repeated across treatment and each individual was only assigned one treatment. Instead, I needed to have the nominal values in a repeated structure across treatments (1,2,3 in C and 1,2,3, in T). I get different results depending on how I have the "individual" random replicate effects structured:  (T-1,2,3, and C-1,2,3) vs (T-1,2,3 and C-4,5,6,)

 

Question: I dont fully understand why a repeated structure across treatments is correct and I am looking for further clarification. 

0 Kudos
1 ACCEPTED SOLUTION

Accepted Solutions
cwillden
Super User

Re: Nominal labeling structure impacting results for random effect in mixed model

Sounds like you got some bad advice.  Unless you nest Subject within Treatment, JMP treats the data as if you have 3 subjects that were measured in both the control and treatment group.  In reality, you have 6 subjects assigned to just 1 group.  That's why you're getting a mismatch, and as far as I can tell you had it right the first time.

If you use the second labeling method, you should get the same result if you nest subject ID in treatment.  I attached an example to illustrate where I generated some data for a fake study with 4 subjects in each treatment level measured at 0 and 1 weeks.  I created 2 subject ID columns to illustrate I could do it either way and get the same results if I nest it properly.  The first script uses unique IDs for each subject.  The second uses nominal IDs that are repeated for each treatment group, but I nest Subject within Treatment.  I get the exact same numbers.  This is because the nesting tells JMP that Subject 1 in the T group is a different person than Subject 1 in the C group.

The third script shows the incorrect way without the nesting.  Now the results are different because JMP treats Subject 1 in both groups as the same person and thinks I have 4 measurements on this person.  This is essentially what I think you have done with your data.

-- Cameron Willden

View solution in original post

3 REPLIES 3
cwillden
Super User

Re: Nominal labeling structure impacting results for random effect in mixed model

Sounds like you got some bad advice.  Unless you nest Subject within Treatment, JMP treats the data as if you have 3 subjects that were measured in both the control and treatment group.  In reality, you have 6 subjects assigned to just 1 group.  That's why you're getting a mismatch, and as far as I can tell you had it right the first time.

If you use the second labeling method, you should get the same result if you nest subject ID in treatment.  I attached an example to illustrate where I generated some data for a fake study with 4 subjects in each treatment level measured at 0 and 1 weeks.  I created 2 subject ID columns to illustrate I could do it either way and get the same results if I nest it properly.  The first script uses unique IDs for each subject.  The second uses nominal IDs that are repeated for each treatment group, but I nest Subject within Treatment.  I get the exact same numbers.  This is because the nesting tells JMP that Subject 1 in the T group is a different person than Subject 1 in the C group.

The third script shows the incorrect way without the nesting.  Now the results are different because JMP treats Subject 1 in both groups as the same person and thinks I have 4 measurements on this person.  This is essentially what I think you have done with your data.

-- Cameron Willden

View solution in original post

joemama985
Community Trekker

Re: Nominal labeling structure impacting results for random effect in mixed model

Thank you very much for the informative response! Nesting subject within treatment gave me the same result as when I ran each subject individually. It is now clear that I need to run it with each individual having a unique nominal identifier and not in a repeated structure across treatment (b.c. jmp will run it as a repeated measure across trts).
0 Kudos
cwillden
Super User

Re: Nominal labeling structure impacting results for random effect in mixed model

I also meant to ask if you have more than 1 data point on each person?  For example, in the data set I uploaded I measured them at 2 time periods.  If you only have 1 data point, then Subject is confounded with the residual (not with the treatment as you were advised).  If that's the case, that's not really a problem.  JMP just drops "Residual" from the REML variance component table and replaces it with "Subject."  Your treatment effect is still totally estimable.

-- Cameron Willden
0 Kudos