Examples (CSPLAN command)

Simple Sample Design

CSPLAN SAMPLE
  /PLAN FILE='/survey/myfile.csplan'
  /DESIGN
  /METHOD TYPE=SIMPLE_WOR
  /SIZE VALUE=100.
  • A single-stage sample design is created that is saved in myfile.csplan.
  • One hundred cases will be selected from the active file when the sample design is executed by the CSSELECT procedure.
  • The extraction method is simple random sampling without replacement.
  • The plan file also includes a default analysis design that uses the EQUAL_WOR estimator (the default when units are extracted using the SIMPLE_WOR method).

Stratified Sample Design

CSPLAN SAMPLE
  /PLAN FILE='/survey/myfile.csplan'
  /DESIGN STRATA=region 
  /METHOD TYPE=SIMPLE_WOR
  /RATE MATRIX=REGION; 'East' 0.1 ; 'West' 0.2; 
                       'North' 0.1; 'South' 0.3.
  • A stratified sample design is specified with disproportionate sampling rates for the strata. Sample elements will be drawn independently within each region.
  • The extraction method is simple random sampling without replacement.
  • CSPLAN generates a default analysis design using region as a stratification variable and the EQUAL_WOR estimator.

Stratified Cluster Sample Design

CSPLAN SAMPLE
  /PLAN FILE='/survey/myfile.csplan'
  /DESIGN STRATA=region CLUSTER=school 
  /METHOD TYPE=PPS_WOR
  /SIZE VALUE=10
  /MOS VARIABLE=mysizevar. 
  • A stratified cluster sample design is specified.
  • Ten schools will be selected within each region with probability proportionate to size.
  • Size values for the strata are read from mysizevar.
  • CSPLAN generates a default analysis design using region as a stratification variable and school as a cluster variable.
  • The UNEQUAL_WOR estimator will be used for analysis. UNEQUAL_WOR is the default when units are sampled with probability proportionate to size.

Multistage Cluster Sample Design

CSPLAN SAMPLE
  /PLAN FILE='/survey/myfile.csplan'
  /DESIGN STAGELABEL='school districts' CLUSTER=district 
  /METHOD TYPE=PPS_WOR
  /RATE VALUE=.2
  /MOS VARIABLE=districtsize 
  /DESIGN STAGELABEL='schools' CLUSTER=school 
  /METHOD TYPE=SIMPLE_WOR
  /RATE VALUE=0.3.
  • A multistage cluster sample design is specified.
  • Twenty percent of school districts will be drawn with probability proportionate to size.
  • Within each selected school district, 30% of schools will be drawn without replacement.
  • CSPLAN generates a default analysis design. Since the PPS_WOR sampling method is specified in stage 1, the UNEQUAL_WOR estimator will be used for analysis for that stage. The EQUAL_WOR method will be used to analyze stage 2.

Simple Analysis Design

CSPLAN ANALYSIS
  /PLAN FILE='/survey/myfile.csaplan'
  /PLANVARS ANALYSISWEIGHT=sampleweight
  /DESIGN
  /ESTIMATOR TYPE=EQUAL_WOR
  /POPSIZE VALUE=5000.
  • An analysis design is specified.
  • The variable sampleweight is specified as the variable containing sample weights for analysis.
  • The EQUAL_WOR estimator will be used for analysis.
  • POPSIZE specifies that the sample was drawn from a population of 5,000.

Simple Analysis Design

CSPLAN ANALYSIS
  /PLAN FILE='/survey/myfile.csaplan'
  /PLANVARS ANALYSISWEIGHT=sampleweight
  /DESIGN
  /ESTIMATOR TYPE=EQUAL_WOR
  /INCLPROB VALUE=0.10.
  • An analysis design is specified.
  • The variable sampleweight is specified as the variable containing sample weights for analysis.
  • The EQUAL_WOR estimator will be used for analysis.
  • INCLPROB specifies that 10% of population units were selected for inclusion in the sample.

Stratified Analysis Design

CSPLAN ANALYSIS 
  /PLAN FILE='/survey/myfile.csaplan'
  /PLANVARS ANALYSISWEIGHT=sampleweight
  /DESIGN STRATA=region 
  /ESTIMATOR TYPE=EQUAL_WOR
  /INCLPROB MATRIX=REGION; 'East' 0.1; 'West' 0.2; 
                           'North' 0.1; 'South' 0.3.
  • The analysis design specifies that the sample is stratified by region.
  • Inclusion probabilities are specified for each stratum.
  • The variable sampleweight is specified as the variable containing sample weights for analysis.

Stratified Clustering Analysis Design

CSPLAN ANALYSIS 
  /PLAN FILE='/survey/myfile.csaplan'
  /PLANVARS ANALYSISWEIGHT=sampleweight
  /DESIGN STRATA=district CLUSTER=school 
  /ESTIMATOR TYPE=UNEQUAL_WOR.
  • The analysis design specifies that units were sampled using stratified clustering.
  • The variable sampleweight is specified as the variable containing sample weights for analysis.
  • District is defined as a stratification variable and school is defined as a cluster variable.
  • The UNEQUAL_WOR estimator will be used for analysis.

Multistage Analysis Design

CSPLAN ANALYSIS 
  /PLAN FILE='/survey/myfile.csaplan'
  /PLANVARS ANALYSISWEIGHT=sampleweight
  /DESIGN CLUSTER=district 
  /ESTIMATOR TYPE=UNEQUAL_WOR
  /DESIGN CLUSTER=school 
  /ESTIMATOR TYPE=EQUAL_WOR
  /INCLPROB VARIABLE=sprob.
  • The analysis design specifies that cases were sampled using multistage clustering. Schools were sampled within districts.
  • The UNEQUAL_WOR estimator will be used in stage 1.
  • The EQUAL_WOR estimator will be used in stage 2.
  • The variable sprob contains inclusion probabilities, which are required for analysis of the second stage.
  • The variable sampleweight is specified as the variable containing sample weights for analysis.

Display Plan

CSPLAN  VIEW
  /PLAN FILE='/survey/myfile.csplan'.
  • The syntax displays the specifications in the plan file myfile.csplan.