Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Svy design statement and svydes error


From   [email protected] (Jeff Pitblado, StataCorp LP)
To   [email protected]
Subject   Re: st: Svy design statement and svydes error
Date   Tue, 29 May 2007 23:49:12 -0500

Arnold Levinson <[email protected]> asks about an error message from
-svydes- when the PSU variable was also specified in the -strata()- option for
the second stage:

> In a two-stage sampling design, I successfully assign the following
> setting:
> 
> svyset class_id [pw=w2f2f3], strata(skulid) fpc(fpc1) || unit,
> strata(class_id) fpc(fpc2)
> 
> When I run -- svydes -- I get an r(198) error:
> 
> variable class_id specified more than once as a survey design
> characteristic
> 
> Am I missing something? How else declare second-stage sampling within
> clusters?

Stata's -svydes- command (and -svy- prefix) will report an error when it finds
that one of the survey design variables is being used in multiple places.
This check is meant to prevent the redundant or erroneous specification of
survey design variables.

The second stage strata are identified by the combinations of values from
three variables:

1.  the -strata()- variable from stage 1
2.  the PSU variable from stage 1
3.  the -strata()- variable from stage 2

If the sampling units were not further stratified (within the PSUs) in the
second stage, the second stage strata are identified by the PSU and -strata()-
variables from stage 1.

Specifying -strata(class_id)- in the second stage is unnecessary.

	. svyset class_id [pw=w2f2f3], strata(skulid) fpc(fpc1)	///
		|| unit, fpc(fpc2)

In other words, a stage 2 -strata()- variable is only necessary when the stage
2 units are sampled using stratification within the stage 1 units.

--Jeff
[email protected]
*
*   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