8
$\begingroup$

I have data from an RCT with one control group and one treatment group and trying to explore mediators for changes in the outcome of interest (i.e. pathways of change). My final model is defined as follows:

Pathway_final <- '
# measurement model
fin_b =~  Save_CT3 + ESSborrow_l_CT3_revers +  ESSborrow_f_CT3_revers 
effi =~ SSE_month_CT3 + SSE_plan_CT3
aspir =~ DS8_CT3 + DS5_CT3_revers + DS4_CT3 +   DS13_CT3  + DS17_CT3 + DS9_CT3_revers +DS21_CT3_revers  
sup_emo  =~  SSS1_CT3 + SSS2_CT3+ SSS3_CT3 +SSS4_CT3+  SSS6_CT3 +SSS7_CT3+ SSS8_CT3 +SSS13_CT3 +SSS14_CT3 +SSS15_CT3 +SSS16_CT3 +SSS17_CT3 +SSS18_CT3 +SSS19_CT3
pos_involv  =~ APQ1_CT3+ APQ4_CT3 + APQ7_CT3 + APQ9_CT3 + APQ11_CT3 + APQ14_CT3 +APQ15_CT3+APQ20_CT3+ APQ23_CT3 + APQ26_CT3 


# regressions
effi ~ TrialArm
sup_emo  ~ TrialArm
aspir ~ TrialArm
pos_involv ~ TrialArm
fin_b ~  effi +  aspir +TrialArm
aspir  ~  sup_emo + pos_involv
effi ~   sup_emo + pos_involv
sup_emo ~ ~ pos_involv
effi ~~ aspir


  # residual correlations
DS8_CT3 ~~   DS4_CT3
DS5_CT3_revers ~~ DS21_CT3_revers
SSS2_CT3 ~~  SSS3_CT3




#orthogonal factors
fin_b ~~ 0*effi
fin_b ~~ 0*aspir
fin_b ~~ 0*sup_emo
fin_b ~~ 0*pos_involv'

However, as treatment was assigned at the village cluster level, I wonder whether standard errors should be clustered? How can I implement the above command?

Cross posted here: https://groups.google.com/forum/#!topic/lavaan/biNdNFm6BmQ

$\endgroup$
7
  • 1
    $\begingroup$ I think you can use the lavaan.survey package. $\endgroup$ Commented Nov 28, 2017 at 17:14
  • $\begingroup$ I added the following commmand: clustered_STS <- svydesign(ids = ~Cluster_AT1a , data = STS_Data) fit.path <- lavaan.survey(fit, survey.design = clustered_STS) It gives me the results but I get the following warning: "Some of the standard errors may not be trustworthy. Some of the observed covariances or means are collinear, and this has generated collinearity in your parameter estimates. This may be a sample size issue, missing data problem, or due to having too few clusters relative to the number of parameters. Problem encountered in group(s)" n cluster was 40. $\endgroup$ Commented Nov 28, 2017 at 17:27
  • 1
    $\begingroup$ Do you have groups with one member? (I'm guessing now). $\endgroup$ Commented Nov 28, 2017 at 18:04
  • $\begingroup$ No - average of 14 members per group - but never below 10 $\endgroup$ Commented Nov 28, 2017 at 18:10
  • 2
    $\begingroup$ Perhaps not enough clusters? See this thread: groups.google.com/forum/#!topic/lavaan/dEW3MkqTTu8 $\endgroup$ Commented Dec 1, 2017 at 18:02

1 Answer 1

3
$\begingroup$

lavaan and cfa options have a cluster argument which will give you cluster robust standard errors. I don't think you need to use lavaan.survey for this one.

For instance, for a cfa:

cfa(model_str, data=my_data, cluster="SubjectId")   
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.