Html Version of SPSS Code to run exemplar 4
It is intended to show you the code and to allow links, not to use
as an SPSS syntax file. The SPSS syntax is in  is the file ex4.sps which you should
save to a file and/or read in to SPSS.
To see output from the commands go to the SPSS results file.

Links in this page Equal opportunities policies weighted and unweighted - Table 4.3 E O policy by workplace size Table 4.4 Other factors by equal opportunities policy Table 4.5 Finite population corrections Table 4.8
Lines starting with * and ending in a full stop are SPSS COMMENTs These are shown in green here
* Written by Gillian Raab August 2004. * SPSS code for exemplar 4 First set up the survey design in a plan file You will probably find it easier to do this in a window, go to >>analyse >>complex samples. * AT first screen give your plan file a name and a place to be saved. * At the second put SERNO in for the PSU (as survey is not clustered) STRATA for strata abd GROSSWT for weight (to get design effects right need a grossing up weight). * At next stage tick WR (with replacement) and you are all set - code below was pasted from this. * Analysis Preparation Wizard. CSPLAN ANALYSIS /PLAN FILE='C:\Documents and Settings\gillian raab\My Documents\aprojects\peas\ex4datafiles\data\ex4plan.csaplan' /PLANVARS ANALYSISWEIGHT=grosswt /PRINT PLAN /DESIGN STRATA= strata CLUSTER= serno /ESTIMATOR TYPE=WR. back to top uparrow *------------------------table 4.3----- again windows and pasting make it easy. * Complex Samples Descriptives. CSDESCRIPTIVES /PLAN FILE = 'C:\Documents and Settings\gillian raab\My Documents\aprojects\peas\ex4datafiles\data\ex4plan.csaplan' /SUMMARY VARIABLES =eo /MEAN /STATISTICS SE COUNT DEFF DEFFSQRT /MISSING SCOPE = ANALYSIS CLASSMISSING = EXCLUDE. *-------------------------------------------------------------------------------------- same thing unweighted, make an unweighted plan file setting all weights to the average weight (471) so they add to the population size -----------------------------------------------------------------------------------------------------. compute constwt=471. * Analysis Preparation Wizard. CSPLAN ANALYSIS /PLAN FILE='C:\Documents and Settings\gillian raab\My Documents\aprojects\peas\ex4datafiles\data\ex4CONplan.csaplan' /PLANVARS ANALYSISWEIGHT=constwt /PRINT PLAN /DESIGN STRATA= strata CLUSTER= serno /ESTIMATOR TYPE=WR. * Complex Samples Descriptives. CSDESCRIPTIVES /PLAN FILE = 'C:\Documents and Settings\gillian raab\My Documents\aprojects\peas\ex4datafiles\data\ex4CONplan.csaplan' /SUMMARY VARIABLES =eo /MEAN /STATISTICS SE COUNT DEFF DEFFSQRT /MISSING SCOPE = ANALYSIS CLASSMISSING = EXCLUDE. back to top uparrow * -------------Table 4.4--------------- by NEMPSIZE-------------. * Complex Samples Descriptives. CSDESCRIPTIVES /PLAN FILE = 'C:\Documents and Settings\gillian raab\My Documents\aprojects\peas\ex4datafiles\data\ex4plan.csaplan' /SUMMARY VARIABLES =eo /SUBPOP TABLE = nempsize DISPLAY=LAYERED /MEAN /STATISTICS SE COUNT DEFF DEFFSQRT /MISSING SCOPE = ANALYSIS CLASSMISSING = EXCLUDE. *--------------------------------------------------------- note design effect for subgroups is not defined wrt a simple random sample within subgroups, so it is a bit odd - see exemplar 2 for more discussion of this -------------------------------------------------------------. back to top uparrow *---------- Table 4.5-------------other factors by EO. * Complex Samples Frequencies. csdescriptives /PLAN FILE = 'C:\Documents and Settings\gillian raab\My Documents\aprojects\peas\ex4datafiles\data\ex4plan.csaplan' /summary VARIABLES = female ethnic . /SUBPOP TABLE = eo DISPLAY=LAYERED /mean /STATISTICS SE COUNT DEFF /MISSING SCOPE = analysis CLASSMISSING = EXCLUDE. * Complex Samples Frequencies. CSTABULATE /PLAN FILE = 'C:\Documents and Settings\gillian raab\My Documents\aprojects\peas\ex4datafiles\data\ex4plan.csaplan' /TABLES VARIABLES = disabgrp /SUBPOP TABLE = eo DISPLAY=LAYERED /CELLS TABLEPCT /STATISTICS SE COUNT /MISSING SCOPE = TABLE CLASSMISSING = EXCLUDE. * And the same thing unweighted by changing plan file. csdescriptives /PLAN FILE = 'C:\Documents and Settings\gillian raab\My Documents\aprojects\peas\ex4datafiles\data\ex4CONplan.csaplan' /summary VARIABLES = female ethnic /SUBPOP TABLE = eo DISPLAY=LAYERED /mean /STATISTICS SE COUNT /MISSING SCOPE = analysis CLASSMISSING = EXCLUDE. * Complex Samples Frequencies. CSTABULATE /PLAN FILE = 'C:\Documents and Settings\gillian raab\My Documents\aprojects\peas\ex4datafiles\data\ex4CONplan.csaplan' /TABLES VARIABLES = disabgrp /SUBPOP TABLE = eo DISPLAY=LAYERED /CELLS TABLEPCT /STATISTICS SE COUNT /MISSING SCOPE = TABLE CLASSMISSING = EXCLUDE. back to top uparrow

*----------------Table 4.8-----------Finite population correction---------------------------------.
* There seems to be a bug in our version ov SPSS 12
it will be fixed in 13 cand we will upgrade and update site.