Announcement

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

  • How to compare coefficients across SEM models?

    Hello,

    Is there a way to compare coefficients across sem models that are not nested?

    For example:
    Model 1: y1 <- x1 x2 x3 x4
    Model 2: y1 <- x1 x2 x3 x5
    Model 3: y1 <- x1 x2 x3 x6
    Model 4: y1 <- x1 x2 x3 x7

    I want to figure out if the coefficients associated with x4 thru x7 are significantly different from each other. Each model is identical in all respects except for those variables. (In this instance, x4 thru x6 are different ways to measure the same construct with x7 being a composite of those measures).

    I know I could do this in a regression format with the suest and subsequent test commands, but suest command isn't allowed in the sem framework. I'm using an sem framework because my dataset only has 75 cases, but 16 of those cases are missing values on key variables in my model. My thinking was I could use the sem framework (with observed variables only) with FIML estimation to account for missing data, so I wouldn't have to lose those 16 cases (like I would in a standard regression model).

  • #2
    There is a -group()- option in sem, but these being separate variables will require you to restructure your data.

    Code:
    sysuse auto, clear
    sem mpg <- turn disp gear weight, method(mlmv)
    sem mpg <- turn disp gear length, method(mlmv)
    
    *RESHAPE
    rename (weight length) var=
    reshape long var, i(make) j(which) string
    encode which, gen(groupvar) 
    
    *JOINT ESTIMATION
     sem (mpg <- turn disp gear var), group(groupvar) method(mlmv)
    
    *TEST (-coeflegend- to see how coefficients are named)
    test _b[mpg:1.groupvar#c.var]=  _b[mpg:2.groupvar#c.var]
    Res.:

    Code:
    . sem mpg <- turn disp gear weight, method(mlmv)
    
    Endogenous variables
    
    Observed:  mpg
    
    Exogenous variables
    
    Observed:  turn displacement gear_ratio weight
    
    Fitting target model:
    
    Iteration 0:   log likelihood = -1339.1709  
    Iteration 1:   log likelihood = -1339.1709  
    
    Structural equation model                       Number of obs     =         74
    Estimation method  = mlmv
    Log likelihood     = -1339.1709
    
    --------------------------------------------------------------------------------
                   |                 OIM
                   |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
    ---------------+----------------------------------------------------------------
    Structural     |
      mpg          |
              turn |  -.1345925   .1746197    -0.77   0.441    -.4768408    .2076557
      displacement |   .0077091   .0112159     0.69   0.492    -.0142737    .0296919
        gear_ratio |   .5694417   1.551143     0.37   0.714    -2.470743    3.609626
            weight |  -.0059168   .0013924    -4.25   0.000    -.0086459   -.0031877
             _cons |   41.26146    7.96542     5.18   0.000     25.64953     56.8734
    ---------------+----------------------------------------------------------------
         var(e.mpg)|   11.34244   1.864686                       8.21807    15.65464
    --------------------------------------------------------------------------------
    LR test of model vs. saturated: chi2(0)   =      0.00, Prob > chi2 =      .
    
    . 
    . sem mpg <- turn disp gear length, method(mlmv)
    
    Endogenous variables
    
    Observed:  mpg
    
    Exogenous variables
    
    Observed:  turn displacement gear_ratio length
    
    Fitting target model:
    
    Iteration 0:   log likelihood = -1089.9339  
    Iteration 1:   log likelihood = -1089.9339  
    
    Structural equation model                       Number of obs     =         74
    Estimation method  = mlmv
    Log likelihood     = -1089.9339
    
    --------------------------------------------------------------------------------
                   |                 OIM
                   |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
    ---------------+----------------------------------------------------------------
    Structural     |
      mpg          |
              turn |  -.1164765   .1862625    -0.63   0.532    -.4815444    .2485914
      displacement |  -.0032826   .0102445    -0.32   0.749    -.0233615    .0167963
        gear_ratio |   1.047017   1.582798     0.66   0.508    -2.055211    4.149245
            length |   -.160631   .0419622    -3.83   0.000    -.2428755   -.0783865
             _cons |   53.59424   8.326451     6.44   0.000     37.27469    69.91378
    ---------------+----------------------------------------------------------------
         var(e.mpg)|   11.77787    1.93627                      8.533558    16.25562
    --------------------------------------------------------------------------------
    LR test of model vs. saturated: chi2(0)   =      0.00, Prob > chi2 =      .
    
    . 
    
    . 
    . *JOINT ESTIMATION
    
    . 
    .  sem (mpg <- turn disp gear var), group(groupvar) method(mlmv)
    
    Endogenous variables
    
    Observed:  mpg
    
    Exogenous variables
    
    Observed:  turn displacement gear_ratio var
    
    Fitting target model:
    
    Iteration 0:   log likelihood = -2429.1049  
    Iteration 1:   log likelihood = -2429.1049  
    
    Structural equation model                       Number of obs     =        148
    Grouping variable  = groupvar                   Number of groups  =          2
    Estimation method  = mlmv
    Log likelihood     = -2429.1049
    
    Group              : length                     Number of obs     =         74
    
    --------------------------------------------------------------------------------
                   |                 OIM
                   |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
    ---------------+----------------------------------------------------------------
    Structural     |
      mpg          |
              turn |  -.1164765   .1862625    -0.63   0.532    -.4815444    .2485914
      displacement |  -.0032826   .0102445    -0.32   0.749    -.0233615    .0167963
        gear_ratio |   1.047017   1.582798     0.66   0.508    -2.055211    4.149245
               var |   -.160631   .0419622    -3.83   0.000    -.2428755   -.0783865
             _cons |   53.59424   8.326451     6.44   0.000     37.27469    69.91378
    ---------------+----------------------------------------------------------------
         var(e.mpg)|   11.77787    1.93627                      8.533558    16.25562
    --------------------------------------------------------------------------------
    
    Group              : weight                     Number of obs     =         74
    
    --------------------------------------------------------------------------------
                   |                 OIM
                   |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
    ---------------+----------------------------------------------------------------
    Structural     |
      mpg          |
              turn |  -.1345925   .1746197    -0.77   0.441    -.4768408    .2076557
      displacement |   .0077091   .0112159     0.69   0.492    -.0142737    .0296919
        gear_ratio |   .5694417   1.551143     0.37   0.714    -2.470743    3.609626
               var |  -.0059168   .0013924    -4.25   0.000    -.0086459   -.0031877
             _cons |   41.26146    7.96542     5.18   0.000     25.64953     56.8734
    ---------------+----------------------------------------------------------------
         var(e.mpg)|   11.34244   1.864686                       8.21807    15.65464
    --------------------------------------------------------------------------------
    LR test of model vs. saturated: chi2(0)   =      0.00, Prob > chi2 =      .
    
    . 
    . 
    . 
    . *TEST (-coeflegend- to see how coefficients are named)
    
    . 
    . test _b[mpg:1.groupvar#c.var]=  _b[mpg:2.groupvar#c.var]
    
     ( 1)  [mpg]1bn.groupvar#c.var - [mpg]2.groupvar#c.var = 0
    
               chi2(  1) =   13.58
             Prob > chi2 =    0.0002
    
    .

    Comment


    • #3
      Thanks Andrew! This is very helpful

      Comment

      Working...
      X