Notice: On March 31, it was **announced** that Statalist is moving from an email list to a **forum**. The old list will shut down on April 23, and its replacement, **statalist.org** is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

From |
"Pagel, Christina" <c.pagel@ucl.ac.uk> |

To |
"statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu> |

Subject |
RE: st: best way to estimate overall mean of clustered, stratified data using xtreg |

Date |
Thu, 13 Sep 2012 09:15:47 +0000 |

Dear Steve, Thanks for replying! The data come from a cluster randomised controlled trial. Basically three different districts were involved. In each district 12 clusters were prospectively chosen and then (within districts) randomised to control or intervention. Within each cluster all births were recorded as well as various protective birth practices associated with each birth. I want to calculate the cluster adjusted mean of the count of birth practices for the control arm only (ie 18 clusters, 6 in each district). The number of births in each cluster ranges from about 350 to 650... does that make it clearer ? Thanks Christina -----Original Message----- From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Steve Samuels Sent: 12 September 2012 11:26 PM To: statalist@hsphsun2.harvard.edu Subject: Re: st: best way to estimate overall mean of clustered, stratified data using xtreg You are describing what was apparently a sample survey of three districts. I would recommend that you -svyset- your data and use -svy: mean-. At the very minimum, you would: svyset village [pweight =??], stratum(district). You will have to supply the probability weight. This advice might change if you describe the study design, sampling process, and purpose in more detail. Steve On Sep 12, 2012, at 1:51 PM, Pagel, Christina wrote: I've got data (9000 ish records) that was collected in 18 clusters (villages) in 3 geographical districts (6 clusters in each district). I've got a variable that is an integer count variable and I want to estimate its mean across all the data, taking clustering into account (since there is definitely intra cluster correlation). If there were no districts I would simply do: Xtreg CountVar, i(TrialCluster) re And then the returned constant would be the mean and I'd also get confidence intervals. To take districts into account (the variable is quite dependent on district), I thought I would do: Xtreg CountVar i.District1 i.District2 i.District3, i(TrialCluster) re Where the District variables are mutually exclusive binary variables saying which district the record is in... The question is how do I now get an overall estimate for the mean from the results? One way I thought of is to generate the estimated value for each record and take the mean of that: Gen EstimatedCount=coeff1*District1+coeff2*District2+coeff3*District3+const And then do: Means EstimatedCount To get the estimate of the mean - this works (as in generates a plausible mean) but the condifidence intervals are far too small to be realistic for this data... which makes me think there must be a better way of doing it! Any suggestions would be gratefully received! Christina * * 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/ * * 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/ * * 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/

**Follow-Ups**:**Re: st: best way to estimate overall mean of clustered, stratified data using xtreg***From:*Steve Samuels <sjsamuels@gmail.com>

**References**:**st: best way to estimate overall mean of clustered, stratified data using xtreg***From:*"Pagel, Christina" <c.pagel@ucl.ac.uk>

**Re: st: best way to estimate overall mean of clustered, stratified data using xtreg***From:*Steve Samuels <sjsamuels@gmail.com>

- Prev by Date:
**Re: st: Average marginal effects in ordered probit models** - Next by Date:
**st: Instrumental variables in time series using GMM** - Previous by thread:
**Re: st: best way to estimate overall mean of clustered, stratified data using xtreg** - Next by thread:
**Re: st: best way to estimate overall mean of clustered, stratified data using xtreg** - Index(es):