Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: svy commands


From   "Sayer, Bryan" <[email protected]>
To   "'[email protected]'" <[email protected]>
Subject   st: RE: svy commands
Date   Mon, 21 Oct 2002 14:49:41 -0400

In general, you don't use the -if option with survey commands.  That is
equivalent to saying the observations excluded by the -if statement are not
in the population sampled from.  Use either the by option or subpop();
Personally, I prefer a table showing all values, that is make "producti" a
row variable of a table with -svytab-.

Bryan Sayer
Statistician, SSS Inc.
[email protected]


-----Original Message-----
From: Theodoropoulos, N. [mailto:[email protected]]
Sent: Monday, October 21, 2002 2:46 PM
To: [email protected]
Subject: st: svy commands


Dear statalisters,

I am using the survey commands in Stata to find some means. I have removed
all the stratums in which one psu (primary sampling unit) is detected. I
check that there is no stratum with one psu for all my variables by using
the svydes command. 
I don't have problems to get the invididual means for the individual
variables "general" and "producti". However when i want to find the mean of
the "general" variable given that "producti" variable is equal to zero i get
the message that a stratum with one psu is detected. The "general" variable
is continuous, and the "producti" variable is binary. 
Any hints will be highly appreciated.
Thanks in advance.

Here is a copy of the output that i get.    

 svymean general

Survey mean estimation

pweight:  empwt_nr                                Number of obs    =
1727
Strata:   newstr1                                 Number of strata =
44
PSU:      newpsu1                                 Number of PSUs   =
162
                                                  Population size  =
1200.4609

----------------------------------------------------------------------------
--
    Mean |   Estimate    Std. Err.   [95% Conf. Interval]        Deff
---------+------------------------------------------------------------------
--
 general |   4.156863    .0044976    4.147957     4.16577    2.432631
----------------------------------------------------------------------------
--

. svymean producti

Survey mean estimation

pweight:  empwt_nr                                Number of obs    =
1727
Strata:   newstr1                                 Number of strata =
44
PSU:      newpsu1                                 Number of PSUs   =
162
                                                  Population size  =
1200.4609

----------------------------------------------------------------------------
--
    Mean |   Estimate    Std. Err.   [95% Conf. Interval]        Deff
---------+------------------------------------------------------------------
--
producti |   .3359512    .0475784    .2417331    .4301693    17.51394
----------------------------------------------------------------------------
--

. svymean general if producti==0
stratum with only one PSU detected
r(460);   
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index