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.

# Re: st: svy: total command

 From Rebecca Pietrelli To statalist@hsphsun2.harvard.edu Subject Re: st: svy: total command Date Wed, 21 Nov 2012 23:43:53 +0100

```Dear Steve,

thank you very much for your suggestions.

Now, my main problems are:

1) File 5 of the dataset presents variables on households that have
former members emigrated - 1645 observations - 191 PSUs. File 6 of the
dataset presents variables on households that have friends who remit
to them - 271 observations - 90 PSUs.
I need info of both files.

2) Some households receive remittances both from former members and friends.

So, first I worked on the two data files separately, in order to
collapse the info for each household in one line. For example in order
to have a dummy = 1 if the household has at least one member who remit
to it.

Then, I merged the two worked files and the first section (File 1) of
the survey, which includes general info for all households of the
survey.
Then:

. svyset earea [pw=hhweight], strata(stratum)

pweight: hhweight
VCE: linearized
Single unit: missing
Strata 1: stratum
SU 1: earea
FPC 1: <zero>

.  . svy: total R_HH, over(stratum)
(running total on estimation sample)

Survey: Total estimation

Number of strata =       2         Number of obs    =     1871
Number of PSUs   =     209         Population size  =  5343613
Design df        =      207

Urban: stratum = Urban
Rural: stratum = Rural

--------------------------------------------------------------
|             Linearized
Over |      Total   Std. Err.     [95% Conf. Interval]
-------------+------------------------------------------------
R_HH         |
Urban |   198172.7   34793.43      129577.7    266767.6
Rural |     732729   71351.81      592059.5    873398.4
--------------------------------------------------------------

This is the total amount of households that receive remittances from
former members, distinguishing households living in urban and rural
areas.

I did the same for the total amount of households that receive
remittances from friends:

. svy: total  R_NON_HH, over(stratum)
(running total on estimation sample)

Survey: Total estimation

Number of strata =       2         Number of obs    =     1871
Number of PSUs   =     209         Population size  =  5343613
Design df        =      207

Urban: stratum = Urban
Rural: stratum = Rural

--------------------------------------------------------------
|             Linearized
Over |      Total   Std. Err.     [95% Conf. Interval]
-------------+------------------------------------------------
R_NON_HH     |
Urban |   74081.45   10843.76      52703.09    95459.82
Rural |   331441.9   53385.76      226192.4    436691.4
--------------------------------------------------------------

Now the PSUs are 209 in both!! (il line with the report. it says 200
but with a small correction).

I think this procedure should work.
What do you think?

Thank you
Rebecca

2012/11/21 Steve Samuels <sjsamuels@gmail.com>:
> ou report the separate totals and the combined total, but with
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/
```