* NOTE THAT WE MUST USE THE grossing-up weight GROSSWT. * or the design effects will not be correct. * Now we need to set up the plan file which can be done. * most easily interactively. * 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 GROSSwt for weight (to get design effects right need a grossing up weight). PSU (prinary sampling unit) for CLUSTER STRATUM for STRATA. * See the exemplar file for the design of the survey. * At next stage tick WR (with replacement) and you are all set - code below was pasted from this and could be just run. * This syntax was generated by pasting from the menu . * You can change the name of the plan file to where you want to save it on your machine. * Analysis Preparation Wizard. CSPLAN ANALYSIS /PLAN FILE='ex2.csaplan' /PLANVARS ANALYSISWEIGHT=grosswt /PRINT PLAN /DESIGN STRATA= stratum CLUSTER= psu /ESTIMATOR TYPE=WR. * Now get proportion of internet use and its standard error adjusting for weighting, stratification and clustering. * You can analyse as complex samples from windows by going to the complex samples and submenus, (this next one is tables) or by pasting the code below into SPSS. * Complex Samples Descriptives. * Complex Samples Frequencies. CSTABULATE /PLAN FILE = 'ex2.csaplan' /TABLES VARIABLES = intuse /CELLS POPSIZE tablepct /STATISTICS SE CIN(95) DEFF DEFFSQRT /MISSING SCOPE = TABLE CLASSMISSING = EXCLUDE. * The remaining analyses shown here are pasted from the SPSS Complex survey procedures, note that you need to have the right plan file this one is a plan ex2 with weighting and clustering. * Complex Samples Frequencies. CSTABULATE /PLAN FILE = 'ex2.csaplan' /TABLES VARIABLES = intuse /SUBPOP TABLE = sex DISPLAY=LAYERED /CELLS TABLEPCT /STATISTICS SE COUNT DEFF /MISSING SCOPE = TABLE CLASSMISSING = EXCLUDE. * Complex Samples Frequencies. * tables by hours used. CSTABULATE /PLAN FILE = 'ex2.csaplan' /TABLES VARIABLES = RC5 /CELLS TABLEPCT /STATISTICS SE CIN(95) DEFF DEFFSQRT /MISSING SCOPE = TABLE CLASSMISSING = EXCLUDE. * Complex Samples Frequencies. * To get proportions by council area. CSTABULATE /PLAN FILE = 'ex2.csaplan' /TABLES VARIABLES = intuse /SUBPOP TABLE = COUNCIL DISPLAY=LAYERED /CELLS TABLEPCT /STATISTICS SE COUNT DEFF /MISSING SCOPE = TABLE CLASSMISSING = EXCLUDE. * Complex Samples Crosstabs. * To get chi-squared tests CSTABULATE /PLAN FILE = 'ex2.csaplan' /TABLES VARIABLES = intuse BY sex /CELLS POPSIZE /STATISTICS SE DEFF DEFFSQRT /TEST ODDSRATIO INDEPENDENCE /MISSING SCOPE = TABLE CLASSMISSING = EXCLUDE. * to check the effect of different designs as for Table 2.4. * It is necessary to set up a new plan file. * This one checks out what the design effects would be without clustering. * It has been given a differnt name here. * Analysis Preparation Wizard. CSPLAN ANALYSIS /PLAN FILE='ex2v2.csaplan' /PLANVARS ANALYSISWEIGHT=grosswt /PRINT PLAN /DESIGN STRATA= stratum CLUSTER= UNIQID /ESTIMATOR TYPE=WR. * Complex Samples Frequencies. CSTABULATE /PLAN FILE = 'ex2v2.csaplan' /TABLES VARIABLES = intuse /CELLS POPSIZE tablepct /STATISTICS SE CIN(95) DEFF DEFFSQRT /MISSING SCOPE = TABLE CLASSMISSING = EXCLUDE.