Announcement

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

  • programming: MI and suest with vce(cluster clustvar)

    Dear all,

    I am following this approach: https://www.stata.com/support/faqs/s...-imputed-data/ in order to combine the suest command with multiply imputed data. The gives me the following code:
    Code:
     cap program drop mysuest
    program mysuest, eclass properties(mi)
            version 12.0
        args model1 model2
    
            qui `model1'
            estimates store est1
            qui `model2'
            estimates store est2
            suest est1 est2
            estimates drop est1 est2
            
            ereturn local title "Seemingly unrelated estimation"
    end
    Which allows me to estimate the following two-stage logit model:
    Code:
    mi estimate: mysuest "logit var1 var2 var3 var4 var5 var6 var7 var8 var9" "logit var10 var2 var3 var4 var5 var6 var7 var8 var9 if var1 == 1"
    However, I want to include clustered standard errors, but I am unsure how to do that. I tried including vce(cluster clustvar) at the end of the logit code, but it reports robust standard errors still. How do I change the programming of the program in order to cluster standard errors appropriately?

    All tips are very much appreciated!

  • #2
    With suest, you cluster when running the command, not in the separate regressions.


    Code:
     cap program drop mysuest
    program mysuest, eclass properties(mi)
            version 12.0
        args model1 model2 cluster
    
            qui `model1'
            estimates store est1
            qui `model2'
            estimates store est2
            suest est1 est2, cluster(`cluster')
            estimates drop est1 est2
            
            ereturn local title "Seemingly unrelated estimation"
    end
    
    mi estimate: mysuest "logit var1 var2 var3 var4 var5 var6 var7 var8 var9" "logit var10 var2 var3 var4 var5 var6 var7 var8 var9 if var1 == 1" "clustervar"
    where "clustervar" is the name of the clustering variable.
    Last edited by Andrew Musau; 14 Mar 2022, 10:09.

    Comment


    • #3
      Perfect! Thank you very much, Andrew!

      Comment

      Working...
      X