.- help for ^svydes^ .- Describe strata, PSUs, and missing data for sample-survey datasets ------------------------------------------------------------------ ^svydes^ [varlist] [weight] [^if^ exp] [^in^ range] [^,^ ^byp^su ^str^ata^(^varname^)^ ^psu(^varname^)^ ^fpc(^varname^)^ ^pweight^s and ^iweight^s are allowed; see help ^weights^. Description ----------- Sample-survey data are typically stratified. Within each stratum, there are primary sampling units (PSUs), which may consist of clusters of observations or individual observations. ^svydes^ displays the following counts for each stratum: the number of primary sampling units (PSUs), the range and mean of the number of observations per PSU, and the total number of observations. If the ^bypsu^ option is specified, it will display counts for each PSU. If a varlist is specified, ^svydes^ will report the number of PSUs that contain at least one observation with complete data for all variables in the varlist. These are exactly the PSUs that would be used to compute estimates for the varlist using ^svy^ estimation commands: . ^svydes varlist^ . ^svymean varlist, complete^ . ^svyreg varlist^ . ^svylogit varlist^ etc. If you get the error message "stratum with only one PSU detected", ^svydes^ will show the stratum (or strata) which has the single PSU. . ^svymean x^ stratum with only one PSU detected r(499); . ^svydes x^ Options ------- ^bypsu^ specifies that results be displayed for each PSU in the dataset; i.e., a separate line of output is produced for every PSU. This option can only be used when a ^psu^ variable has been specified using the ^psu()^ option or set with ^varset^. ^strata(^varname^)^ specifies the name of the variable (numeric or string) that contains stratum identifiers. ^strata()^ can also be specified with the ^varset^ command; see examples below and help @varset@. ^psu(^varname^)^ specifies the name of the variable (numeric or string) that contains identifiers for the primary sampling unit (i.e., the cluster). ^psu()^ can also be specified with the ^varset^ command; see examples below and help @varset@. ^fpc(^varname^)^ can be set here or with the ^varset^ command; see examples below and help for @svymean@ and @varset@. Note ---- Setting weights and ^fpc()^ will report any observations with missing values for the weights or ^fpc()^ variable. Other than this, setting weights and ^fpc()^ does nothing. Examples -------- Typing ^svydes^ alone will show the numbers of PSUs, etc., for each stratum for your dataset: . ^svydes^ ^svydes^ can be used to determine patterns of missing values. This is useful when missing values create strata with single PSUs: . ^svymean x^ stratum with only one PSU detected r(499); . ^svydes x^ Remember that ^_all^ can be used to represent all variables in the dataset. . ^svydes _all^ Varlist abbreviations are useful. . ^svydes x*^ . ^svydes x1-x10^ . ^svydes zinc-lead^ The regression commands ^svyreg^, ^svylogit^, and ^svyprobt^ always use complete cases, so include the entire varlist when running ^svydes^. . ^svyreg y x1 x2 x3^ stratum with only one PSU detected r(499); . ^svydes y x1 x2 x3^ If you are using the ^complete^ option with ^svymean^, ^svytotal^, or ^svyratio^, you should use the entire varlist with ^svydes^: . ^svymean tcresult tgresult hdresult, complete^ stratum with only one PSU detected r(499); . ^svydes tcresult tgresult hdresult^ If you are using the ^available^ option or available is the default (which is the case when there are missing values), you simply need to analyze the problem variable by itself: . ^svymean tcresult tgresult hdresult^ Survey mean estimation pweight: finalwgt Number of obs(*) = 10351 Strata: strata Number of strata = 31 PSU: psu Number of PSUs = 62 Population size = 1.172e+08 ------------------------------------------------------------------------------ Mean | Estimate Std. Err. [95% Conf. Interval] Deff ---------+-------------------------------------------------------------------- tcresult | 213.0977 1.127252 210.7986 215.3967 5.602499 tgresult | 138.576 2.071934 134.3503 142.8018 2.356968 hdresult | (stratum with 1 PSU detected) ------------------------------------------------------------------------------ (*) Some variables contain missing values. . ^svydes hdresult^ When the total number of PSUs is not large, you may want to view counts for each individual PSU: . ^svydes hdresult, bypsu^ When producing estimates for subpopulations, the variables specified with ^by()^ should also be included in the varlist for ^svydes^ in case they contain missing values: . ^svymean albumin, by(sex race)^ stratum with only one PSU detected r(499); . ^svydes albumin sex race^ Also see -------- On-line: help for @svymean@, @svyprop@, @svyreg@, @varset@