Multigroup Analysis with binary outcome, equal constraints problem

104 views
Skip to first unread message

Chong Man Chow

unread,
Jun 5, 2023, 10:53:19 AM6/5/23
to lavaan
Dear All

I ran into an obstacle when trying to estimate a path model with binary outcome. In the model below, I have the DV gun_purchase as a binary outcome variable, and I have used the DWLS estimator. The model is estimated for White, NonWhiteMinority, and Asian groups (3 groups analysis). It was found that the variance for White in the DV gun_purchase is negative. Trying to tackle the negative variance issue, I tried to constrain the variance for the variable to be equal across 3 groups with
'gun_purchase ~~ c(v1,v1,v1)*gun_purchase' but it would not do the job (the variances still came up to be different, and one of them is negative). 

I also have tried to fix the negative variance for the first group to be 0 by using 
'gun_purchase ~~ c(0,v2,v2)*gun_purchase' . But again, the line won't work. 

Any suggestions on how to handle this issue would be much appreciated. 

gun_purchase.model1 <-
+ '
+
+ #covariates
+ gun_purchase ~ gendergrp  + agegrp_31_50 + agegrp_51_64 + agegrp_65_Older + maritalstatusgrp_married + incomegrp_35000_49999 +
+ incomegrp_50000_74999 + incomegrp_75000_99999 + incomegrp_100000_more + educationgrp_some_college + educationgrp_college_graduate_above
+
+
+ scovid_antic_discr ~ gendergrp + agegrp_31_50 + agegrp_51_64 + agegrp_65_Older + maritalstatusgrp_married + incomegrp_35000_49999 +
+ incomegrp_50000_74999 + incomegrp_75000_99999 + incomegrp_100000_more + educationgrp_some_college + educationgrp_college_graduate_above
+
+ mentalhealth ~ gendergrp + agegrp_31_50 + agegrp_51_64 + agegrp_65_Older + maritalstatusgrp_married + incomegrp_35000_49999 +
+ incomegrp_50000_74999 + incomegrp_75000_99999 + incomegrp_100000_more + educationgrp_some_college + educationgrp_college_graduate_above
+
+ alcohol ~ gendergrp + agegrp_31_50 + agegrp_51_64 + agegrp_65_Older + maritalstatusgrp_married + incomegrp_35000_49999 +
+ incomegrp_50000_74999 + incomegrp_75000_99999 + incomegrp_100000_more + educationgrp_some_college + educationgrp_college_graduate_above
+
+
+ #Main model
+ gun_purchase ~  c(p6.0, p6.1, p6.2)*mentalhealth + c(p4.0, p4.1, p4.2)*scovid_antic_discr + c(p5.0, p5.1, p5.2)*alcohol
+
+ alcohol ~ c(p2.0, p2.1, p2.2)*scovid_antic_discr + c(p3.0, p3.1, p3.2)*mentalhealth
+
+ mentalhealth ~ c(p1.0, p1.1, p1.2)*scovid_antic_discr
+
+
+ gun_purchase ~~ c(v1, v2, v3)*gun_purchase
+
+ '
> gun_purchase.model1.fit <- sem(gun_purchase.model1, data = df, estimator="DWLS", group = "racegrp1")
Warning: lavaan WARNING: group variable ‘racegrp1’ contains missing values
Warning: lavaan WARNING: correlation between variables mentalhealth and gun_purchase is (nearly) 1.0Warning: lavaan WARNING: trouble constructing W matrix; used generalized inverse for A11 submatrixWarning: lavaan WARNING:
    Could not compute standard errors! The information matrix could
    not be inverted. This may be a symptom that the model is not
    identified.Warning: lavaan WARNING: some estimated ov variances are negative
> summary(gun_purchase.model1.fit, fit.measures=TRUE)
lavaan 0.6-11.1676 ended normally after 352 iterations

  Estimator                                       DWLS
  Optimization method                           NLMINB
  Number of model parameters                       174
                                                     
  Number of observations per group:               Used       Total
    White                                          198         253
    NonAsianMinority                               208         268
    Asian                                          823         916
                                                                 
Model Test User Model:
                                                     
  Test statistic                                    NA
  Degrees of freedom                                -3
  P-value (Unknown)                                 NA
  Test statistic for each group:
    White                                           NA
    NonAsianMinority                                NA
    Asian                                           NA

User Model versus Baseline Model:

  Comparative Fit Index (CFI)                       NA
  Tucker-Lewis Index (TLI)                          NA

Root Mean Square Error of Approximation:

  RMSEA                                             NA
  90 Percent confidence interval - lower            NA
  90 Percent confidence interval - upper            NA
  P-value RMSEA <= 0.05                             NA

Standardized Root Mean Square Residual:

  SRMR                                           0.000

Parameter Estimates:

  Standard errors                             Standard
  Information                                 Expected
  Information saturated (h1) model        Unstructured


Group 1 [White]:

Regressions:
                       Estimate  Std.Err  z-value  P(>|z|)
  gun_purchase ~                                          
    gndrgrp               0.194       NA                  
    a_31_50              -0.264       NA                  
    a_51_64               0.671       NA                  
    ag_65_O               0.026       NA                  
    mrtlst_              -0.017       NA                  
    i_35000               0.764       NA                  
    i_50000               0.311       NA                  
    i_75000               0.114       NA                  
    i_10000               0.521       NA                  
    edctn__               4.869       NA                  
    edct___               5.261       NA                  
  scovid_antic_discr ~                                    
    gndrgrp               0.555       NA                  
    a_31_50              -0.247       NA                  
    a_51_64              -0.635       NA                  
    ag_65_O              -1.034       NA                  
    mrtlst_              -0.017       NA                  
    i_35000              -0.205       NA                  
    i_50000               0.100       NA                  
    i_75000               0.066       NA                  
    i_10000              -0.013       NA                  
    edctn__               0.108       NA                  
    edct___               0.200       NA                  
  mentalhealth ~                                          
    gndrgrp              -0.165       NA                  
    a_31_50              -0.033       NA                  
    a_51_64              -0.357       NA                  
    ag_65_O              -0.545       NA                  
    mrtlst_               0.049       NA                  
    i_35000              -0.490       NA                  
    i_50000              -0.160       NA                  
    i_75000              -0.359       NA                  
    i_10000              -0.441       NA                  
    edctn__              -0.007       NA                  
    edct___               0.122       NA                  
  alcohol ~                                              
    gndrgrp               0.219       NA                  
    a_31_50              -0.286       NA                  
    a_51_64              -0.923       NA                  
    ag_65_O              -1.088       NA                  
    mrtlst_              -0.609       NA                  
    i_35000              -0.287       NA                  
    i_50000               0.121       NA                  
    i_75000              -0.006       NA                  
    i_10000               0.598       NA                  
    edctn__               0.764       NA                  
    edct___               0.761       NA                  
  gun_purchase ~                                          
    mntlhlt (p6.0)        1.240       NA                  
    scvd_n_ (p4.0)       -0.214       NA                  
    alcohol (p5.0)        0.140       NA                  
  alcohol ~                                              
    scvd_n_ (p2.0)        0.435       NA                  
    mntlhlt (p3.0)       -0.023       NA                  
  mentalhealth ~                                          
    scvd_n_ (p1.0)        0.346       NA                  

Intercepts:
                   Estimate  Std.Err  z-value  P(>|z|)
   .gun_purchase      0.000                          
   .scovd_ntc_dscr    1.105       NA                  
   .mentalhealth      1.833       NA                  
   .alcohol           2.749       NA                  

Thresholds:
                   Estimate  Std.Err  z-value  P(>|z|)
    gun_purchas|t1    9.463       NA                  

Variances:
                   Estimate  Std.Err  z-value  P(>|z|)
   .gun_prchs (v1)   -0.064       NA                  
   .scvd_ntc_         0.922       NA                  
   .mentlhlth         0.609       NA                  
   .alcohol           3.209       NA                  

Scales y*:
                   Estimate  Std.Err  z-value  P(>|z|)
    gun_purchase      1.000                          


Group 2 [NonAsianMinority]:

Regressions:
                       Estimate  Std.Err  z-value  P(>|z|)
  gun_purchase ~                                          
    gndrgrp               0.293       NA                  
    a_31_50              -0.513       NA                  
    a_51_64              -0.232       NA                  
    ag_65_O              -0.614       NA                  
    mrtlst_              -0.542       NA                  
    i_35000               0.001       NA                  
    i_50000               0.530       NA                  
    i_75000               0.459       NA                  
    i_10000               0.239       NA                  
    edctn__              -0.132       NA                  
    edct___              -0.031       NA                  
  scovid_antic_discr ~                                    
    gndrgrp               0.038       NA                  
    a_31_50              -0.225       NA                  
    a_51_64              -0.849       NA                  
    ag_65_O              -0.951       NA                  
    mrtlst_              -0.355       NA                  
    i_35000               0.047       NA                  
    i_50000              -0.490       NA                  
    i_75000               0.156       NA                  
    i_10000              -0.409       NA                  
    edctn__              -0.022       NA                  
    edct___              -0.035       NA                  
  mentalhealth ~                                          
    gndrgrp               0.013       NA                  
    a_31_50              -0.496       NA                  
    a_51_64              -0.630       NA                  
    ag_65_O              -0.880       NA                  
    mrtlst_              -0.324       NA                  
    i_35000              -0.035       NA                  
    i_50000              -0.165       NA                  
    i_75000              -0.459       NA                  
    i_10000              -0.409       NA                  
    edctn__              -0.021       NA                  
    edct___              -0.133       NA                  
  alcohol ~                                              
    gndrgrp               0.047       NA                  
    a_31_50               0.506       NA                  
    a_51_64               0.109       NA                  
    ag_65_O              -0.229       NA                  
    mrtlst_              -0.572       NA                  
    i_35000               0.335       NA                  
    i_50000               0.928       NA                  
    i_75000               0.221       NA                  
    i_10000               0.511       NA                  
    edctn__              -0.116       NA                  
    edct___              -0.085       NA                  
  gun_purchase ~                                          
    mntlhlt (p6.1)        0.164       NA                  
    scvd_n_ (p4.1)        0.342       NA                  
    alcohol (p5.1)       -0.075       NA                  
  alcohol ~                                              
    scvd_n_ (p2.1)        0.395       NA                  
    mntlhlt (p3.1)        0.174       NA                  
  mentalhealth ~                                          
    scvd_n_ (p1.1)        0.320       NA                  

Intercepts:
                   Estimate  Std.Err  z-value  P(>|z|)
   .gun_purchase      0.000                          
   .scovd_ntc_dscr    3.077       NA                  
   .mentalhealth      2.335       NA                  
   .alcohol           2.692       NA                  

Thresholds:
                   Estimate  Std.Err  z-value  P(>|z|)
    gun_purchas|t1    1.141       NA                  

Variances:
                   Estimate  Std.Err  z-value  P(>|z|)
   .gun_prchs (v2)    0.788       NA                  
   .scvd_ntc_         1.377       NA                  
   .mentlhlth         0.520       NA                  
   .alcohol           3.766       NA                  

Scales y*:
                   Estimate  Std.Err  z-value  P(>|z|)
    gun_purchase      1.000                          


Group 3 [Asian]:

Regressions:
                       Estimate  Std.Err  z-value  P(>|z|)
  gun_purchase ~                                          
    gndrgrp               0.366       NA                  
    a_31_50              -0.299       NA                  
    a_51_64              -0.993       NA                  
    ag_65_O              -0.696       NA                  
    mrtlst_              -0.467       NA                  
    i_35000               0.430       NA                  
    i_50000               0.286       NA                  
    i_75000               0.102       NA                  
    i_10000               0.339       NA                  
    edctn__              -0.098       NA                  
    edct___               0.087       NA                  
  scovid_antic_discr ~                                    
    gndrgrp              -0.013       NA                  
    a_31_50              -0.338       NA                  
    a_51_64              -0.866       NA                  
    ag_65_O              -0.772       NA                  
    mrtlst_              -0.124       NA                  
    i_35000              -0.182       NA                  
    i_50000              -0.166       NA                  
    i_75000              -0.085       NA                  
    i_10000              -0.060       NA                  
    edctn__               0.058       NA                  
    edct___               0.010       NA                  
  mentalhealth ~                                          
    gndrgrp              -0.089       NA                  
    a_31_50              -0.285       NA                  
    a_51_64              -0.418       NA                  
    ag_65_O              -0.644       NA                  
    mrtlst_              -0.058       NA                  
    i_35000               0.064       NA                  
    i_50000               0.041       NA                  
    i_75000              -0.054       NA                  
    i_10000              -0.126       NA                  
    edctn__              -0.167       NA                  
    edct___              -0.202       NA                  
  alcohol ~                                              
    gndrgrp               0.355       NA                  
    a_31_50               0.327       NA                  
    a_51_64              -0.089       NA                  
    ag_65_O              -0.128       NA                  
    mrtlst_              -0.234       NA                  
    i_35000               0.200       NA                  
    i_50000               0.320       NA                  
    i_75000               0.401       NA                  
    i_10000               0.602       NA                  
    edctn__               0.134       NA                  
    edct___               0.325       NA                  
  gun_purchase ~                                          
    mntlhlt (p6.2)        0.150       NA                  
    scvd_n_ (p4.2)        0.184       NA                  
    alcohol (p5.2)        0.113       NA                  
  alcohol ~                                              
    scvd_n_ (p2.2)        0.273       NA                  
    mntlhlt (p3.2)        0.305       NA                  
  mentalhealth ~                                          
    scvd_n_ (p1.2)        0.246       NA                  

Intercepts:
                   Estimate  Std.Err  z-value  P(>|z|)
   .gun_purchase      0.000                          
   .scovd_ntc_dscr    2.373       NA                  
   .mentalhealth      1.900       NA                  
   .alcohol           0.808       NA                  

Thresholds:
                   Estimate  Std.Err  z-value  P(>|z|)
    gun_purchas|t1    2.244       NA                  

Variances:
                   Estimate  Std.Err  z-value  P(>|z|)
   .gun_prchs (v3)    0.880       NA                  
   .scvd_ntc_         0.985       NA                  
   .mentlhlth         0.465       NA                  
   .alcohol           2.983       NA                  

Scales y*:
                   Estimate  Std.Err  z-value  P(>|z|)
    gun_purchase      1.000                           

Terrence Jorgensen

unread,
Jun 12, 2023, 9:35:35 AM6/12/23
to lavaan
There are a few issues here.

I tried to constrain the variance for the variable to be equal across 3 groups with
'gun_purchase ~~ c(v1,v1,v1)*gun_purchase'
 
Residual variances are not model parameters under the default parameterization="delta".  Even if you change to  parameterization="theta", those parameters are fixed to 1 for identification, so they would already be equal.


I also have tried to fix the negative variance for the first group to be 0 by using 
'gun_purchase ~~ c(0,v2,v2)*gun_purchase' . But again, the line won't work. 

Here, you are mixing labels (character strings) with numerical values (for fixing/freeing parameters).  Those have to be specified separately.

gun_purchase ~~ c(0, NA, NA)*gun_purchase + c(v1, v2, v2)*gun_purchase

But this still won't run because your latent-response scale (which you could interpret as "propensity to purchase a gun", assumed normally distributed) is not identified.

The biggest problem you have is that the slopes are NOT COMPARABLE across groups.  The latent response scale is set in each group using an arbitrary identification constraint, so the "units" are not the same.  The way to link latent (locations and) scales across groups is to constrain thresholds to equality, but that requires 2 thresholds (1 to identify the intercept, 1 to identify the marginal or residual variance).  Binary data have only 1 threshold, so group differences in variance are completely confounded with group differences in intercepts.
Paul Allison and others (e.g., Breen) have brought up this issue before, sometimes in the context of logistic regression (same issue, if you believe in the latent-response interpretation). 

Any suggestions on how to handle this issue would be much appreciated. 

Running a single-group model with dummy/contrast codes for groups would side-step the issue, although the same assumption is merely implicit (and the residual variance would be equal by definition, under either parameterization, perhaps avoiding the negative one).  The moderation by group would have to represented the OLS regression way, by calculating product terms and testing them.  

Terrence D. Jorgensen
Assistant Professor, Methods and Statistics
Research Institute for Child Development and Education, the University of Amsterdam

Chong Man Chow

unread,
Jun 12, 2023, 10:31:18 AM6/12/23
to lav...@googlegroups.com
Hi Terrence

Thank you so much for the detailed response. They are very helpful. I will try to come up with an alternative strategy to deal with the data.

Thanks,
Chong.

--
You received this message because you are subscribed to a topic in the Google Groups "lavaan" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/lavaan/6c7pr1q8aHE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to lavaan+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lavaan/e88f06b7-ba61-422a-9473-6dda7661f425n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages