Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • SEM on Repeated Measures Data

    Dear Statalist users,
    I am using Stata 14 SE. The dataset I use come from a pre-test/post-test study. The main dependent variable(DV) is a latent variable measured by 9 questions asked in both pre-test and post-test.
    Time variable is called 'wave(w),' and pre-test is w1 and post-test is w1. Each individual observation has a unique number under variable 'ID'. The treatment variable is called 'Treatment,' and takes the value of 1 for the treatment group.
    To operationalize the DV, I had run factor analysis and also SEM and predicted the latent variables. So far I have been using "xtmixed" command with the predicted latent variables from the pre- and post-test as the DV to test for the effect of the treatment.
    Yet, upon reading the advices on Statalist against using predicted variables and for using SEM (combining a measurement structural model), I decided to give SEM a go.
    However, I am not sure how to proceed.

    The variables(items) I use in the measurement model are 4-category ordinal variables. Items are called i1, i2, i3, ..i9, and the factors are called f1, f2 and f3. I also look into a fourth latent variable, f4, which may be an overarching construct (second-order factor) which f1, f2 and f3 loads strongly on. To generate the latent variables from pre-test(w1) and post-test(w2), I use the wide-form dataset and the following commands:

    Code:
    sem    
    (f1_w1 -> i1_w1,)   (f1_w1 -> i2_w1,)   (f1_w1 -> i3_w1,)  
    (f2_w1 -> i4_w1,)   (f2_w1 -> i5_w1,)   (f2_w1 -> i6_w1,)   (f2_w1 -> i7_w1,)  
    (f3_w1 -> i7_w1,)   (f3_w1 -> i8_w1,)   (f3_w1 -> i9_w1,)  
    (f4_w1 -> f1_w1,)   (f4_w1 -> f2_w1,)   (f4_w1 -> f3_w1,)   ,  
    difficult latent (f1_w1 f2_w1 f3_w1 f4_w1) nocapslatent  
    
    predict f1_w1 f2_w1 f3_w1 f4_w1, latent
    Code:
    sem    
    (f1_w2 -> i1_w2,)   (f1_w2 -> i2_w2,)   (f1_w2 -> i3_w2,)    
    (f2_w2 -> i4_w2,)   (f2_w2 -> i5_w2,)   (f2_w2 -> i6_w2,)   (f2_w2 -> i7_w2,)      
    (f3_w2 -> i7_w2,)   (f3_w2 -> i8_w2,)   (f3_w2 -> i9_w2,)    
    (f4_w2 -> f1_w2,)   (f4_w2 -> f2_w2,)   (f4_w2 -> f3_w2,)  ,
    difficult latent (f1_w2 f2_w2 f3_w2 f4_w2) nocapslatent
    
    predict f1_w2 f2_w2 f3_w2 f4_w2, latent
    Then, I reshape the dataset into a long-form, using each of the factors, I ran models with Group and wave interaction the independent variables such as age, sex, education, ideology etc.

    Code:
     xtmixed f1_w i.Treatment##i.wave i. Male i.Age i.Educ ideology || ID:, var reml
     xtmixed f2_w i.Treatment##i.wave i. Male i.Age i.Educ ideology || ID:, var reml
     xtmixed f3_w i.Treatment##i.wave i. Male i.Age i.Educ ideology || ID:, var reml
     xtmixed f4_w i.Treatment##i.wave i. Male i.Age i.Educ ideology || ID:, var reml
    In order to combine these two models (measurement model for the latent dependent variables and the structural model), how should I shape my data? I appreciate any guidance on how my SEM model would/should look like.
    Last edited by Sule Yaylaci; 01 Jun 2018, 11:39.
Working...
X