Dear Statalist,
I am fitting linear mixed models to assess the prospective associations of a categorical independent variable with a continuous dependent variable.
TV viewing is the categorical independent variable: <1 (reference), 1, 2, 3, 4+ hours/day. This was assessed at baseline. IQ score is the continuous dependent variable: a score in units ranging from 0 to 13 (Higher scores on this test indicates better cognitive function). This was assessed at both baseline and follow-up (~ 5 years later).
I am interested in understanding:
(a) whether TV viewing is associated with IQ score?
(b) whether IQ score changes over time?
(c) the association between TV viewing and change in IQ score (i.e. is there a change in the strength of the association over time)
In order to answer (a) and (b) I first fit the following linear mixed model in Stata/MP 14.0:
* linear mixed model 1
mixed fluid_intelligence age0 i.sex i.TVsed0 t, || ID:, level(99)
Note:
Output:

From the model, if my understanding is correct, I know that:
In order to try and answer (c), I fitted a further model where I included an interaction term between TV viewing and time:
* linear mixed model 2
mixed fluid_intelligence age0 i.sex i.TVsed0 t i.TVsed0##c.t, || ID:, level(99)
Output:

The problem
Now I am having trouble understanding and interpreting this interaction term between the TV viewing and time (and whether this interaction term really answers my question or not – or is it even needed to answer it?!).
I have tried the margins command to shed some light here:
* margins TVsed0, dydx(t)
Output:

My understanding is that these are the slopes associated with different levels of TV viewing? A linear combination of the time term and the interaction terms in the linear mixed model 2?
Could anyone please shed some light here on whether an interaction term is needed to answer the question, and if yes, how it should be interpreted?
Thank you so much in advance for your help,
Best wishes,
Kishan
I am fitting linear mixed models to assess the prospective associations of a categorical independent variable with a continuous dependent variable.
TV viewing is the categorical independent variable: <1 (reference), 1, 2, 3, 4+ hours/day. This was assessed at baseline. IQ score is the continuous dependent variable: a score in units ranging from 0 to 13 (Higher scores on this test indicates better cognitive function). This was assessed at both baseline and follow-up (~ 5 years later).
I am interested in understanding:
(a) whether TV viewing is associated with IQ score?
(b) whether IQ score changes over time?
(c) the association between TV viewing and change in IQ score (i.e. is there a change in the strength of the association over time)
In order to answer (a) and (b) I first fit the following linear mixed model in Stata/MP 14.0:
* linear mixed model 1
mixed fluid_intelligence age0 i.sex i.TVsed0 t, || ID:, level(99)
Note:
- Data were in panel (i.e. long) format.
- Participant ID was included as a random effect.
- ‘time (in years [at baseline: 0, and at follow-up: no. of follow-up years])’ was included as a continuous variable (denoted as ‘t’ in the model).
- The model was also adjusted for baseline age and sex.
Output:
From the model, if my understanding is correct, I know that:
- the beta coefficient for TV viewing tells us the association between TV viewing and IQ score (i.e. answers my part a)). Here, higher levels of TV viewing are associated with lower IQ scores.
- the beta coefficient for ‘time’ tells us whether the IQ score changes over time (i.e. answers my part b)). Here, IQ scores decrease over time.
In order to try and answer (c), I fitted a further model where I included an interaction term between TV viewing and time:
* linear mixed model 2
mixed fluid_intelligence age0 i.sex i.TVsed0 t i.TVsed0##c.t, || ID:, level(99)
Output:
The problem
Now I am having trouble understanding and interpreting this interaction term between the TV viewing and time (and whether this interaction term really answers my question or not – or is it even needed to answer it?!).
I have tried the margins command to shed some light here:
* margins TVsed0, dydx(t)
Output:
My understanding is that these are the slopes associated with different levels of TV viewing? A linear combination of the time term and the interaction terms in the linear mixed model 2?
Could anyone please shed some light here on whether an interaction term is needed to answer the question, and if yes, how it should be interpreted?
Thank you so much in advance for your help,
Best wishes,
Kishan
Comment