6.3 Descriptive statistics and graphical displays: SPSS syntax

 6.3.1 Original data file 
** Original data file. 
get file="latestdata.sav". 

* the title-by-status model was conducted on base units named 
* {h/w}bst3 in their original values, {h/w}bst4 as autorecoded values. 
* and the final title-by-status model treated all cases with psdm1=1 as pseudo-diagonals. 
* the title-only model was conducted on base units named 
* {h/w}occ5 in their original values, {h/w}occ6 as autorecoded values. 
* and the final title-only model treated all cases with psdm2=1 as pseudo-diagonals. 
sav out="temp1.sav" /keep=pidid 
 hbst wbst hocc wocc hempst wempst hbst3 wbst3 hocc3 wocc3 hempst3 wempst3 hbst4 
 wbst4 hocc4 wocc4 hempst4 wempst4 hbst5 wbst5 hocc5 wocc5 hempst5 wempst5 hbst6 
 wbst6 hocc6 wocc6 hempst6 wempst6 psdm1 psdm2 freq . 

6.3.2 Read title-only base unit scores from output table 
** Read title-only base unit scores from output table. 
data list file="tir1u1p1scores1.dat" 
   free / occ6 httot wttot htusd wtusd htd1 wtd1 . 

* occ6 is the revised and 'square autorecoded' value of the occupational title unit. 
* {h/w}ttot are the total number of cases originally representing the unit for men and women. 
* {h/w}tusd are the number of cases representing the unit for men and women after psuedo- 
* diagonal combinations have been excluded. 
* {h/w}td1 are the (dimension 1) derived CAMSIS scores for the relevant units. 
* note that the number of 'used' and 'original' cases could also have been derived from 
* the original data files after being treated for pseudo-diagonals through syntax files. 
sort cases by occ6. 
sav out="timen.sav" /keep=occ6 httot htusd htd1 /rename(occ6=hocc6). 
sav out="tifem.sav" /keep=occ6 wttot wtusd wtd1 /rename(occ6=wocc6). 

6.3.3 Read title-by-status base unit scores from output table 
** Read title-by-status base unit scores from output table. 
data list file="str1u1p1scores1.dat" 
      free / occbst4 hstot wstot hsusd wsusd hsd1 wsd1 . 

* occbst4 is the revised and 'square autorecoded' value of the occupational title-by-status unit. 
* {h/w}stot are the total number of cases originally representing the unit for men and women. 
* {h/w}susd are the number of cases representing the unit for men and women after psuedo- 
* diagonal combinations have been excluded. 
* {h/w}sd1 are the (dimension 1) derived CAMSIS scores for the relevant units.
* note that the number of 'used' and 'original' cases could also have been derived from 
* the original data files after being treated for pseudo-diagonals through syntax files. 
sort cases by occbst4. 
sav out="stmen.sav" /keep=occbst4 hstot hsusd hsd1 
   /rename(occbst4=hbst4). 
sav out="stfem.sav" /keep=occbst4 wstot wsusd wsd1 
   /rename(occbst4=wbst4). 

6.3.4 Match the scores up with the original data files 
** Match the scores up with the original data files. 
*** Prelim (4) : 
* In principle, because the original data has the original and derived occupational 
* units on the same cases, we can match directly by the derived units. 
* However, there is a complication which arises from out treatment of pseudo-diagonals : 
* the occupational units of some pseudo-diagonal combinations may have been adjusted to a different 
* derived value (eg hbst3 then 4) than the other cases contributing to those occupational units. 
* Eg, most hbst=4285 may have been recoded to hbst3=4245, but those that were pseduo-diagonals may have hbst3=5555. 
* to overcome, we need to reassign some cases their derived units as if they had not been pseudo-diagonals. 
* Adjustment for this issue :. 

* i) title only :. 

get file=temp1.sav. 
sav out="part1.sav" /drop=hbst5 wbst5 hocc5 wocc5 hempst5 wempst5 hbst6 wbst6 hocc6 wocc6 hempst6 wempst6 . 
get file=temp1.sav. 
select if (psdm2=0). 
sort cases by hocc. 
compute first=1. 
if (lag(hocc)=hocc) first=0. 
select if (first=1). 
sav out="part2.sav" /keep=hocc hbst5 hocc5 hempst5 hbst6 hocc6 hempst6 . 
get file=temp1.sav. 
select if (psdm2=0). 
* (pseudo-diagonal indicator for title-only models). 
sort cases by wocc. compute first=1. 
if (lag(wocc)=wocc) first=0. 
select if (first=1). 
sav out="part3.sav" /keep=wocc wbst5 wocc5 wempst5 wbst6 wocc6 wempst6 . 
get file="part1.sav". 
sort cases by hocc. 
match files file=* /table="part2.sav" /by=hocc. 
sort cases by wocc. 
match files file=* /table="part3.sav" /by=wocc. 
recode hbst5 wbst5 hocc5 wocc5 hempst5 wempst5 hbst6 wbst6 hocc6 wocc6 
    hempst6 wempst6 (missing,sysmis=-999). 
execute. 

* ii) title by status :. 

sav out="part4.sav" /drop=hbst3 wbst3 hocc3 wocc3 hempst3 wempst3 hbst4 wbst4 hocc4 wocc4 hempst4 wempst4 . 
get file=temp1.sav. 
select if (psdm1=0). 
* (pseudo-diagonal indicator for title-by-status models). 
sort cases by hbst. 
compute first=1. 
if (lag(hbst)=hbst) first=0. 
select if (first=1). 
sav out="part5.sav" /keep=hbst hbst3 hocc3 hempst3 hbst4 hocc4 hempst4 . 
get file=temp1.sav. 
select if (psdm2=0). 
sort cases by wbst. 
compute first=1. 
if (lag(wbst)=wbst) first=0. 
select if (first=1). 
sav out="part6.sav" /keep=wbst wbst3 wocc3 wempst3 wbst4 wocc4 wempst4 . 
get file="part4.sav". 
sort cases by hbst. 
match files file=* /table="part5.sav" /by=hbst. 
sort cases by wbst. 
match files file=* /table="part6.sav" /by=wbst. 
recode hbst3 wbst3 hocc3 wocc3 hempst3 wempst3 hbst4 wbst4 hocc4 wocc4 hempst4 wempst4 
                     (missing,sysmis=-999). 
execute. 
sav out=temp2.sav". 
* Above should have now corrected initial problem, 
units only have 
* a corresponding score if they are based on a non-pseudo-diagonal score. 
* (Note a few units which were in initial survey may not have any score attributed to 
* them because they were represented only by cases which were recoded as pseudo-diagonals). 

**** EO Prelim (4). 

get file="temp2.sav". 
sort cases by hocc6. 
match files file=* /in=htipres / table="timen.sav" /by=hocc6. 
select if (htipres=1). 
sort cases by wocc6. 
match files file=* /in=wtipres / table="tifem.sav" /by=wocc6. 
select if (wtipres=1). 
sort cases by hbst4. 
match files file=* /in=hstpres / table="stmen.sav" /by=hbst4. 
select if (hstpres=1). 
sort cases by wbst4. 
match files file=* /in=wstpres 
         / table="stfem.sav" /by=wbst4. 
select if (wstpres=1). 
recode htd1 wtd1 hsd1 wsd1 (missing,sysmis=-999). 
missing vallues htd1 wtd1 hsd1 wsd1 (-999). sav out="fulldata.sav". 
* this file now has all the original data cases, plus scores 
* matched to them according to how they were distributed into the 
* autorecoded units. 

6.3.5 Calculate population distribution statistics 
** Calculate population distribution statistics :. 
* (note that at no stage have we specified the direction of the scales - 
* positive or negative values could be interpreted as advantage or disadvantage differently 
* for different versions). 
* check : any missing cases?. 
descriptives /var=htd1 wtd1 hsd1 wsd1 httot htuse wttot wtuse hstot hsuse wstot wsuse /statistics=all. 

** 5.1) All the population, even if relevant cases were excluded as pseudo-diagonals :. 
weight by freq. 
* Basic descriptives : . 
descriptives /var=htd1 wtd1 hsd1 wsd1 /statistics=all. 
* Some histograms and scatterplots :. 
graph /histogram(normal)=htd1. 
graph /histogram(normal)=wtd1. 
graph /histogram(normal)=hsd1. 
graph /histogram(normal)=wsd1. 
graph /scatterplot=htd1 with wtd1. 
graph /scatterplot=hsd1 with wsd1. 
graph /scatterplot=htd1 with hsd1. 
graph /scatterplot=wtd1 with wsd1. 
* Husband-wife correlations :. 
correlate /var=htd1 wtd1 hsd1 wsd1. 
weight off. 
** 5.2) Repeat on only the population not excluded as pseudo-diagonals :. 
compute m1freq=freq*(psdm1=0). 
compute m2freq=freq*(psdm2=0). 
* let psdm1 refer to pseudo-diagonals of title-by-status model, 
* and psdm2 refer to pseudo-diagonals of title-only model. 
* title-only :. 
weight by m2freq. 
* Basic descriptives : . 
descriptives /var=htd1 wtd1 /statistics=all. 
* Some histograms and scatterplots :. 
graph /histogram(normal)=htd1. 
graph /histogram(normal)=wtd1. 
graph /scatterplot=htd1 with wtd1. 
* Husband-wife correlations :. 
correlate /var=htd1 wtd1 . weight off. 
* title-by-status :. 
weight by m1freq. 
* Basic descriptives : . 
descriptives /var= hsd1 wsd1 /statistics=all. 
* Some histograms and scatterplots :. 
graph /histogram(normal)=hsd1. 
graph /histogram(normal)=wsd1. 
graph /scatterplot=hsd1 with wsd1. 
* Husband-wife correlations :. 
correlate /var=hsd1 wsd1. 
weight off. 


Return to Score distributions


Last modified 14 February 2002
This document is maintained by Paul Lambert (paul.lambert@stirling.ac.uk)