*------------------------------------------------------------------------------------------ Preparing exemplar 4 data from data on the ESRC archive This program ex4_prep.sps has anonymisation code removed Original is in ex4_prep_orig.sps -------------------------------------------------------------------------------------------. IMPORT FILE='C:\Documents and Settings\gillian raab\My Documents\aprojects\peasorig\web\exemp4\dataarchive\mq98fin.por'. save outFILE='C:\Documents and Settings\gillian raab\My Documents\aprojects\peasorig\web\exemp4\dataarchive\mq98fin.sav'. match files file='C:\Documents and Settings\gillian raab\My Documents\aprojects\peasorig\web\exemp4\dataarchive\mq98fin.sav' /table 'C:\Documents and Settings\gillian raab\My Documents\aprojects\peasorig\web\exemp4\dataarchive\sample98.sav' /by serno. execute. .* ------------------------compute derived variables-----------------. compute zfemale=zfemfull+zfemprt. compute ethnico=(zethnic)*100/zallemps. compute disab=zdisab*100/zallemps. RECODE disab (0=0) (0 thru 3=1) (3 thru Highest=2) INTO disabgrp . EXECUTE . recode ipolicy(1=1)(2=0) into eo. execute. value labels eo 1 'equal opps policy' 0 'no eo policy'/ disabgrp 0 'none' 1 'under 3%' 2' 3% or more'. variable labels female 'Percentage of workforce female'/ disabgrp 'Percentage of workforce disabled, grouped'/ ethnic 'Percentage of workforce from minority ethnic group'/ eo 'equal opps policy recoded to 0 1'. execute. compute strata=idbrstr2 . sampfrac=idbrsf2. * save as spss file. save outfile='C:\Documents and Settings\gillian raab\My Documents\aprojects\peasorig\web\exemp4\dataarchive\ex4.sav' /keep serno est_wt female nempsize disabgrp ethnic eo strata sampfrac/COMPRESSED. execute. . get file='C:\Documents and Settings\gillian raab\My Documents\aprojects\peasorig\web\exemp4\dataarchive\ex4.sav' . *save as sas file. SAVE TRANSLATE OUTFILE='C:\Documents and Settings\gillian raab\My Documents\aprojects\peasorig\web\exemp4\dataarchive\ex4.sas7bdat' /TYPE=SAS /VERSION=7 /PLATFORM=WINDOWS /MAP /REPLACE /VALFILE='C:\Documents and Settings\gillian raab\My Documents\aprojects\peasorig\web\exemp4\dataarchive\ex4_formats.sas' . * save as sas transport file for R and Stata. SAVE TRANSLATE OUTFILE='C:\Documents and Settings\gillian raab\My Documents\aprojects\peasorig\web\exemp4\dataarchive\ex4.xpt' /TYPE=SAS /VERSION=X /MAP /REPLACE .