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 |
|
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
|
|
|
|
|
How do I account for clustering within families?
By: vega25 on Fri, 11 April 2014 00:01
|
|
|
Re: How do I account for clustering within families?
By: user-rhs on Fri, 11 April 2014 14:15
|
|
|
Re: How do I account for clustering within families?
|
|
|
Re: How do I account for clustering within families?
By: vega25 on Sat, 12 April 2014 01:26
|
|
|
Re: How do I account for clustering within families?
By: user-rhs on Sat, 12 April 2014 09:41
|
|
|
Re: How do I account for clustering within families?
|
|
|
Re: How do I account for clustering within families?
|
|
|
Re: How do I account for clustering within families?
By: Liz-DHS on Sun, 13 April 2014 18:48
|
|
|
Re: How do I account for clustering within families?
|
|
|
Re: How do I account for clustering within families?
By: Liz-DHS on Thu, 17 April 2014 12:42
|
|
|
Re: How do I account for clustering within families?
By: Liz-DHS on Fri, 18 April 2014 13:51
|
|
|
Re: How do I account for clustering within families?
By: Liz-DHS on Thu, 24 April 2014 13:28
|
|
|
Re: How do I account for clustering within families?
By: vega25 on Wed, 03 December 2014 20:33
|
|
|
Re: How do I account for clustering within families?
By: user-rhs on Wed, 03 December 2014 20:43
|
|
|
Re: How do I account for clustering within families?
|
|
|
Re: How do I account for clustering within families?
|
|
|
Re: How do I account for clustering within families?
By: ab803 on Thu, 21 September 2017 21:37
|
|
|
Re: How do I account for clustering within families?
|
|
|
Re: How do I account for clustering within families?
By: ab803 on Mon, 25 September 2017 00:43
|
|
|
Re: How do I account for clustering within families?
|
|
|
Re: How do I account for clustering within families?
By: ab803 on Tue, 26 September 2017 01:24
|
|
|
Re: How do I account for clustering within families?
|
Goto Forum:
Current Time: Thu Dec 12 15:11:31 Coordinated Universal Time 2024
|