Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | Katherine King <katherinekingphd@gmail.com> |
To | statalist@hsphsun2.harvard.edu |
Subject | st: 3-level model syntax calling HLM from Stata |
Date | Mon, 13 Aug 2012 12:07:31 -0400 |
I am running Sean Reardon's -hlm module within Stata (version 10). I have been successfully using this setup for months on this machine with 2-level models. However, now I want to run 3-level models with individuals in tracts in regions. My question is about the syntax for 3-level models when calling from Stata. Reardon's documentation covers 2-level models but includes a command for 3-level models. First, I successfully created the mdm and other files: hlm mkmdm using filename, id2(tract) id3(region) l1(`l1var') l2(`l2var') l3(`l3var') miss(analysis) nodta replace Then I attempted to run a 3-level model: hlm hlm3 depvar int(int rand) wgt1(weight1) rand, cmd(depvar) run noeq robust replace Response from Stata: Too few variables specified r(102); I also tried (this is wrong): hlm hlm3 depvar int(int rand (int rand)) wgt1(weight1) rand, cmd(depvar) run noeq robust replace In a previous post to this list, someone had asked this question but the matter was not resolved as the person was referred to xtmixed. In my experience, xtmixed is too slow, and the results are different enough to cause problems. Could someone please share the correct syntax for a basic 3-level model using Stata to call HLM? Thank you, Katherine * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/