|
|
|
||||
|
Stat Computing > WesVar > FAQ
|
|
||||
This example is taken from Levy and Lemeshow's Sampling of Populations.
page 173 stratified random sampling with poststratification
A short "movie" of how to convert the SAS data set wvdogscats into a WesVar data set can be viewed by clicking here.
Also, a text file called dogspost was created that contains the strata and poststratification totals needed. This file was created in SAS and exported as a text file. Note that when doing this, you need to open the file in a text editor, such as Notepad or Wordpad, to ensure that there is nothing in the file other than the numbers. Many programs, when creating such a text file, will put the variable name on the first line. This variable name, and any other text, needs to be deleted before the file can be used in WesVar.
A second "movie" shows how to analyze the data once it is in WesVar format. You can view that movie by clicking here.
In this example, the variable weight is used as the weight variable, the variable id is used as the VarUnit, and the variable totexp is used as the analysis variable. The variable type is used to make the table. The jackknife-1 (jk1) method of creating the replicate weight is used because we do not have stratification in this design.
The output (shown at the end of the analysis "movie") is given below.

The marginal sum_wts value of 1300 is the estimated population total. In the next row, we see that 42379.6719 is the estimated total of the variable totexp for strata 1, and in the next row, 9770 is the estimated total of totexp for strata 2. The marginal totexp value of 52149.6719 is the estimated total of the variable totexp (including both strata), and its standard error is 1574.2557. The estimated mean value of totexp for strata 1 is 49.8584 and for strata 2 the estimated mean value of totexp is 21.7111. The marginal mean value of 40.1151 is the estimated mean of the variable totexp, and 1.2110 is its standard error.
UCLA Researchers are invited to our Statistical Consulting Services
We recommend others to our list of Other Resources for Statistical Computing Help
These pages are Copyrighted (c) by UCLA Academic Technology Services