# Linear Mixed Model Analysis with multiple fixed factors

#### risu

##### New Member
Hellow,

Here is a question on linear mixed model analysis for an intervention

The study composed of two group of subjects who receive a DrugA versus Placebo and their Cholestrol and Sugars measured at baseline, six months and 12 months.

So i did a simple analysis to detect the changes with time and drugA using nlme in R

model1 = lme(Cholesterol~Time+Group,random=~1|Patient_id) where Time and Group are fixed and PatientID is random

and for Sugar,

model2 = lme(Sugar~Time+Group,random=~1|Patient_id)

I got a significant change with time and Group in Cholesterol

But the same subjects were also receiving some other drugs (B,C and D) in such a manner that some of them receive all(A,B and C) while some receive A &B and so on!

What will be the best way to explore for e.g those who received drug B showed a response to DrugA where as the rest wont?

Here is a snapshot of variables (attached)

#### risu

##### New Member
sorry to bump, no answers! kindly let me know if something is missing/unclear in the post. Thanks in advance

#### mostater

##### New Member
But the same subjects were also receiving some other drugs (B,C and D) in such a manner that some of them receive all(A,B and C) while some receive A &B and so on!

What will be the best way to explore for e.g those who received drug B showed a response to DrugA where as the rest wont?
Hi risu,
Why don't you add B, C, and D as additional independent variables to your model? That should adjust for their effects when evaluating drug A. Also, consider modeling the interaction between drug A and time to see if the association between drug A and cholesterol/sugar changes over time. Maybe the impact of drug A decreases over time?

#### risu

##### New Member
Thanks mostater,

Now i did like this ,

modelA=lme(Cholesterol~Time+Group+drugB+drugC+drugD,random=~1|Patient_id,method="ML")
modelB=lme(Cholesterol~Time*Group+drugB+drugC+drugD,random=~1|Patient_id,method="ML")

anova(modelA,modelB)
Model df AIC BIC logLik Test L.Ratio p-value
modelA 1 13 174.1280 213.7761 -74.06401
modelB 2 15 178.0266 223.7744 -74.01328 1 vs 2 0.1014577 0.9505

Should i keep the interaction term? Now am getting the effect from drug B , C and D as well. Also can see the p-values from

summary(modelA)\$tTable

Please confirm if am doing it right.

Thanks again for the feedback

#### mostater

##### New Member
modelA=lme(Cholesterol~Time+Group+drugB+drugC+drugD,random=~1|Patient_id,method="ML")
modelB=lme(Cholesterol~Time*Group+drugB+drugC+drugD,random=~1|Patient_id,method="ML")
When you look at the interaction between time and group be sure to include the individual effects as well. I am not certain if the model B statement above does that or if it needs to be re-stated as follows:
modelB=lme(Cholesterol~Time+Group+Time*Group+drugB+drugC+drugD,random=~1|Patient_id,method="ML")

If the interaction term from this model is not significant, then you can drop it in favor of model A as you have it above, which is much simpler to interpret. If the interaction is significant, then I suggest you evaluate the group effect (on cholesterol/sugar) at each time point. If interaction exists, you should see the effect change over time. That is, the difference between treatment and placebo will vary across the 3 time points.

anova(modelA,modelB)
Model df AIC BIC logLik Test L.Ratio p-value
modelA 1 13 174.1280 213.7761 -74.06401
modelB 2 15 178.0266 223.7744 -74.01328 1 vs 2 0.1014577 0.9505
I am not sure what you are attempting to do here. Are you evaluating the residuals from each of the models to determine if they are different? I don't think this step is necessary. The AIC and BIC can be used to compare models. Regardless, I still recommend running the model with interaction as described above to determine whether it should remain in the model or not.

Hope this helps!