The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Topics » Child Health » How do I account for clustering within families?
Re: How do I account for clustering within families? [message #2006 is a reply to message #2005] Sat, 12 April 2014 09:41 Go to previous messageGo to previous message
user-rhs is currently offline  user-rhs
Messages: 132
Registered: December 2013
Senior Member
Dear Vega,
If you are so inclined, you can run a mixed model where household is nested within sampling cluster. Depending on what your outcome is, you can try -xtmixed- for multilevel mixed effects linear regression or -xtmelogit- for multilevel mixed effects logistic regression. For other outcomes, use -gllamm-, which I should warn is a beast* to run, and will probably take at least half a day to complete the procedure (and sometimes, after 3 days of running, you still don't get convergence................the point is, do NOT run -gllamm- if you're pressed for time). As I do not have Stata 13, I can't tell you whether there is a less clunky procedure that is equivalent to -gllamm- built into Stata 13. (Reduced-for(u)m, if you have Stata 13, does such a procedure exist?)

Sample syntax
xtmixed outcome covariate1 covariate2 || cluster: || hhid:


If you suspect that having random slopes makes sense for some variables you can list the variables for which you want random slopes estimated after the colons, e.g.
xtmixed outcome covariate1 covariate2 || cluster: covariate3 || hhid:

****Note, this is usually an exception rather than norm and controlling for clustering via the cluster and household fixed effects is sufficient for most purposes.


For more information, visit the documentation for -xtmixed-, -xtmelogit-, -gllamm-, and the Bristol University Centre for Multilevel Modelling:
- http://www.stata.com/help.cgi?xtmixed
- http://www.stata.com/help.cgi?xtmelogit
- http://www.gllamm.org/
- http://www.bristol.ac.uk/cmm/learning/online-course/index.ht ml


HTH,
RHS


*I have only the utmost respect for Prof. Sophia Rabe-Hesketh who wrote -gllamm- (and is co-author of the Stata Press books on multilevel modeling). GLLAMM is very flexible and powerful but takes a long time to run. The flexibility also means you have to read the documentation properly to make sure you won't get error warnings for failing to specify required "options" for the specific model you are trying to fit!

[Updated on: Sat, 12 April 2014 09:44]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Ethiopia treatment sources: more detail on country-specific labels?
Next Topic: analysis of preceding and succeeding birth interval in children's data file
Goto Forum:
  


Current Time: Sun Sep 15 04:17:22 Coordinated Universal Time 2024