Forms survey weights (S.D. Langton).
Options
PRINT = string token |
Controls printed output (summary , stratumsummary , psusummary ); default summ , stra , psus |
---|---|
PLOT = string token |
Controls which high-resolution graphs are plotted (weights ); default * i.e. none |
STRATUMFACTOR = factor |
Stratification factor; default * , i.e. unstratified |
NUNITS = tables, scalars or variates |
Numbers of units in each STRATUMFACTOR (for a multistage design these will be the number of primary sampling units) |
SAMPLINGUNITS = factor |
Factor indicating the primary sampling units; default * , i.e. single stage design. |
NSECONDARYUNITS = tables, scalars or variates |
Numbers of secondary sampling units for each level of the SAMPLINGUNITS factor |
Parameters
Y = variates or scalars |
Response data or a scalar indicating the number of sampled units |
---|---|
OUTWEIGHTS = variates |
Saves weights |
Description
SVWEIGHT
creates weights for surveys. The information about the numbers of sampling units in the survey population can be supplied in one of two ways.
1. The option NUNITS
can be used to list the number of primary sampling units per stratum using a table or variate with one value for each stratum. Similarly, in a two-stage design, NSECONDARYUNITS
indicates the number of secondary units in each primary sampling unit.
2. The dataset can contain the full survey population with unsampled (or non-responding) units indicated by missing values for the response variables (Y
parameter). This allows Genstat to deduce the numbers of units without the need to supply any further information; it is thus simple to use, but is not feasible with large or complex surveys. The NUNITS
(and NSECONDARYUNITS
if appropriate) option should be set to a value of -1 to indicate that this is required.
With the first method the Y
parameter can be left unset, except in the case of a simple random sample, where it must be set in order for the procedure to know the number of sampled units; in this case Y
can either be set to a variate containing the responses or to a scalar containing the number of sampled units. Other information on the survey design is provided using the STRATUMFACTOR
and SAMPLINGUNITS
options. The OUTWEIGHTS
parameter saves the variate of weights (corresponding to each response variable in the case where more than one Y
variable is set).
The PRINT
option allows you to print various summaries, and you can set PLOT=weights
to plot a histograms of the weights.
Options: PRINT
, PLOT
, STRATUMFACTOR
, NUNITS
, SAMPLINGUNITS
, NSECONDARYUNITS
.
Parameters: Y
, OUTWEIGHTS
.
Method
The procedure uses the methods for survey analysis described in most survey analysis textbooks, calculating weights as the inverse of the probabilities of inclusion (see for example, Sarndal et al. 1992).
Action with RESTRICT
Any restrictions on Y
, SAMPLINGUNITS
, STRATUMFACTOR
or WEIGHTS
are ignored.
Reference
Sarndal, C., Swenssion, B. & Wretman, J. (1992). Model Assisted Survey Sampling. Springer-Verlag, New York.
See also
Procedures: SVBOOT
, SVCALIBRATE
, SVGLM
, SVHOTDECK
, SVREWEIGHT
, SVSAMPLE
, SVSTRATIFIED
, SVTABULATE
.
Commands for: Survey analysis.
Example
CAPTION 'SVWEIGHT example',!t(\ 'Orkney oats data (Sampford, Table 5.1, page 61).',\ 'Stratified analysis as Table 6.1, page 73'); STYLE=meta,plain VARIATE Oats READ Oats 15 20 18 18 23 27 25 60 28 128 69 72 : FACTOR [LEVELS=3; VALUES=4(1,2,3)] Stratum TABLE [CLASSIFICATION=Stratum; VALUES=12,12,11] N SVWEIGHT [PRINT=summary; STRATUM=Stratum; NUNITS=N] OUTWEIGHTS=weights CAPTION 'Check weights give correct total by comparing to SVSTRATIFIED result' PRINT SUM(weights*Oats);DECIMALS=2 SVSTRATIFIED [PRINT=totals; STRATUMFACTOR=Stratum] Oats; NUNITS=N CAPTION 'SVWEIGHT example 2',!t('Province 91 data',\ '(Lehtonen & Pahkinen, Table 3.7 & 3.8, page 88-9).');\ STYLE=meta,plain VARIATE UE91; DECIMALS=0 FACTOR CLU; DECIMALS=0 READ [SERIAL=yes] CLU,UE91 2 3 3 2 4 7 4 7 : 760 767 142 187 94 262 98 219 : VARIATE [VALUES=4(4)] nsu SVWEIGHT [PRINT=summary,psusummary; SAMPLINGUNITS=CLU; NUNITS=8; NS=nsu]\ OUTWEIGHTS=wt2stage PRINT SUM(wt2stage*UE91); DECIMALS=0 CAPTION 'SVWEIGHT example 3',!t('Province 91 data',\ '(Lehtonen and Pahkinen, Table 3.5 & 3.6, page 83-4),',\ 'using full population format.'); STYLE=meta,plain VARIATE UE91; DECIMALS=0 FACTOR CLU; DECIMALS=0 READ [SERIAL=yes] CLU,UE91 1 2 2 2 3 5 3 5 6 7 4 4 8 8 3 5 1 2 4 5 6 6 7 1 7 8 4 3 1 6 7 8 : * 666 528 760 * * * * * * * * 129 128 * * * 187 * * * * * * * 331 * * * * * 568 : SVWEIGHT [PRINT=summary,psusummary; SAMPLINGUNITS=CLU;\ NUNITS=-1; NSECONDARYUNITS=-1] UE91; OUTWEIGHTS=WGHT PRINT CLU,WGHT,UE91;DECIMALS=0 PRINT SUM(WGHT*UE91);DECIMALS=0