0

I ran a longitudinal model in RStudio looking at senior citizens and depression and am writing up the results, but my colleague and I disagree on how to interpret the model.

I have:

summary(lme.1<- lme(Depression ~ Memory+Gender+Age, random=~Year|ID, data=df, na.action=na.omit))  

Our data has people (ID) measured 4 times over the Year for depression and other characteristics.

When I describe the model that we've run do I wrote it as:

Level 1: Yit = π0i +π1i(Memory) +π2i(Gender) +π3i(Age) +εit
         π0i = β00 + r0i 
Level 2: 
π1i= β10+ r1i
π2i= β20+ r2i
π3i= β30+ r3i

Or am I misrepresenting where the memory, gender, and age variables go? As far as I understand it I did not include any of the variables on level 2. Should I? I don't understand what would be different or how I would code it differently in RStudio if they were level 2 variables.

iPlexpen
  • 409
  • 1
  • 4
  • 13

1 Answers1

1

First, Age and Year are two perfectly correlated variables, hence below I will replace them with a time variable t.
The code given by @Quixotic becomes:

lme(Depression ~ Memory+Gender+t, random=~t|ID, data=df, na.action=na.omit)

which estimates the model

Yit = (β0 + r0i) + β1(Memory) + β2(Gender) + (β3 + r3i)(t) + εit   
                                            where r0i~N(0,σ0) and r3i~N(0,σ3)

The terms Depression ~ Memory+Gender+te and ~t|ID are the fixed and the random parts of the mixed-effect model respectively, hence coefficients π1, π2, π3 are fixed for all the subjects.

The random intercept and slope model that @Quixotic described above can be estimated by:

lme(Depression ~ Memory+Gender+t, random=~Memory+Gender+t|ID, 
    data=df, na.action=na.omit)
Marco Sandri
  • 23,289
  • 7
  • 54
  • 58