7.2.2 Attributing scores: SPSS syntax

7.2.2.1

 
** 1) Unit specific scores : Select one case per occupational unit only. 
* matching proceeds separately for each unit and gender group. 
* (the 'inf' variables are calculated to enable post-hoc weighting through the {h/w}tot vars). 
get file="fulldataandscores.sav". 
sort cases by hocc6. 
compute hinft=1. 
if (hocc6=lag(hocc6)) hinft=0. 
sort cases by hocc. 
compute first=1. 
if (hocc=lag(hocc)) first=0. 
select if (first=1). 
sav out="mtcha.sav" /keep=hocc htd1cs zhtd1 htot husd hinft 
  /rename(hocc=occ). 
get file="fulldataandscores.sav". 
sort cases by wocc6. 
compute winft=1. 
if (wocc6=lag(wocc6)) winft=0. 
sort cases by wocc. 
compute first=1. 
if (wocc=lag(wocc)) first=0. 
select if (first=1). 
sav out="mtchb.sav" /keep=wocc wtd1cs zwtd1 wtot wusd winft 
     /rename(wocc=occ). 
get file="fulldataandscores.sav". 
sort cases by hbst4. 
compute hinfs=1. 
if (hbst4=lag(hbst4)) hinfs=0. 
sort cases by hbst. 
compute first=1. 
if (hbst=lag(hbst)) first=0. 
select if (first=1). 
sav out="mtchc.sav" /keep=hbst hsd1cs zhsd1 hstot hsusd hinfs /rename(hbst=occbst). 
get file="fulldataandscores.sav". 
sort cases by wbst4. compute winfs=1. 
if (wbst4=lag(wbst4)) winfs=0. 
sort cases by wbst. 
compute first=1. 
if (wbst=lag(wbst)) first=0. 
select if (first=1). 
sav out="mtchd.sav" /keep=wbst wsd1cs zwsd1 wstot wsusd winfs /rename(wbst=occbst). 
* (in these files, a couple of units may have missing score values, in the even, as 
* mentioned above, of them being represented only by cases which are treated as pseudo-diagonals). 

7.2.2.2 
** 2) Generate subgroup average scores (weighting by total population). 
** (this example : 3 occupational subgroups, major, sub-major and minor). 
get file="fulldataandscores.sav". 
** export the averages to separate files. weight by freq. 
* Men, title base unit :. 
sort cases by h1gp. 
aggregate outfile="mtch1a.sav" /break=h1gp /o1htm o1zhtm=mean(htd1cs) mean(zhtd1). 
sort cases by h2gp. 
aggregate outfile="mtch2a.sav" /break=h2gp /o2htm o2zhtm=mean(htd1cs) mean(zhtd1). 
sort cases by h3gp. 
aggregate outfile="mtch3a.sav" /break=h3gp /o3htm o3zhtm=mean(htd1cs) mean(zhtd1). 
* Women, title base unit :. 
sort cases by w1gp. 
aggregate outfile="mtch1b.sav" /break=w1gp /o1wtm o1zwtm=mean(wtd1cs) mean(zwtd1). 
sort cases by w2gp. 
aggregate outfile="mtch2b.sav" /break=w2gp /o2wtm o2zwtm=mean(wtd1cs) mean(zwtd1). 
sort cases by w3gp. 
aggregate outfile="mtch3b.sav" /break=w3gp /o3wtm o3zwtm=mean(wtd1cs) mean(zwtd1). 
* Men, title-by-status base unit :. 
sort cases by h1gp. 
aggregate outfile="mtch1c.sav" /break=h1gp /o1hsm o1zhsm=mean(hsd1cs) mean(zhsd1). 
sort cases by h2gp. 
aggregate outfile="mtch2c.sav" /break=h2gp /o2hsm o2zhsm=mean(hsd1cs) mean(zhsd1). 
sort cases by h3gp. 
aggregate outfile="mtch3c.sav" /break=h3gp /o3hsm o3zhsm=mean(hsd1cs) mean(zhsd1). 
sort cases by hocc. 
aggregate outfile="mtch7c.sav" /break=hocc /o4hsm o4zhsm=mean(hsd1cs) mean(zhsd1). 
sort cases by h1gpst. 
aggregate outfile="mtch4c.sav" /break=h1gpst   /o1shsm o1szhsm=mean(hsd1cs) mean(zhsd1). 
sort cases by h2gpst. 
aggregate outfile="mtch5c.sav" /break=h2gpst /o2shsm o2szhsm=mean(hsd1cs) mean(zhsd1). 
sort cases by h3gpst. 
aggregate outfile="mtch6c.sav" /break=h3gpst /o3shsm o3zshsm=mean(hsd1cs) mean(zhsd1). 
* Women, title-by-status base unit :. 
sort cases by w1gp. 
aggregate outfile="mtch1d.sav" /break=w1gp /o1wsm o1zwsm=mean(wsd1cs) mean(zwsd1). 
sort cases by w2gp. 
aggregate 
outfile="mtch2d.sav" /break=w2gp /o2wsm o2zwsm=mean(wsd1cs) mean(zwsd1). 
sort cases by w3gp. 
aggregate outfile="mtch3d.sav" /break=w3gp /o3wsm o3zwsm=mean(wsd1cs) mean(zwsd1). 
sort cases by wocc. 
aggregate outfile="mtch7d.sav" /break=wocc /o4wsm o4zwsm=mean(wsd1cs) mean(zwsd1). 
sort cases by w1gpst. 
aggregate outfile="mtch4d.sav" /break=w1gpst /o1swsm o1szwsm=mean(wsd1cs) mean(zwsd1). 
sort cases by w2gpst. 
aggregate outfile="mtch5d.sav" /break=w2gpst /o2swsm o2szwsm=mean(wsd1cs) mean(zwsd1). 
sort cases by w3gpst. 
aggregate outfile="mtch6d.sav" /break=w3gpst /o3swsm o3szwsm=mean(wsd1cs) mean(zwsd1). 
weight off. 

7.2.2.3 

** 3) Match base unit scores and distribute subgroup mean scores 
** to index file. 
** First 
the unit specific scores :. 
get file="indexbase.sav". 
sort cases by occ. 
match files file=* /file="mtcha.sav" /in=hoccorig /file="mtchb.sav" /in=woccorig /by=occ. 
sort cases by occbst. 
match files file=* /file="mtchc.sav" /in=hbstorig /file="mtchd.sav" /in=wbstorig /by=occbst. 
* Demonstration : distribution of unit scores using weights:. 
compute htota=htot*hinft. 
compute wtota=wtot*winft. 
compute husda=husd*hinft. 
compute wusda=wusd*winft. 
compute hstota=hstot*hinfs. 
compute wstota=wstot*winfs. 
compute hsusda=hsusd*hinfs. 
compute wsusda=wsusd*winfs. 
variable label htota "Total cases originally contributing to male title scores". 
variable label wtota "Total cases originally contributing to female title scores". 
variable label husda "Used (non pseudo-d) cases originally contributing to male title scores". 
variable label wusda "Used (non pseudo-d) cases originally contributing to female title scores". 
variable label hstota "Total cases originally contributing to male title-by-status scores". 
variable label wstota "Total cases originally contributing to female title-by-status scores". 
variable label hsusda "Used (non pseudo-d) cases originally contributing to male title-by-status scores". 
variable label wsusda "Used (non pseudo-d) cases originally contributing to female title-by-status scores". 
weight by htota. 
descriptives /var=htd1cs zhtd1. 
weight by husda. 
descriptives /var=htd1cs zhtd1. 
weight by wtota. 
descriptives /var=wtd1cs zwtd1. 
weight by wusda. 
descriptives /var=wtd1cs zwtd1. 
weight by hstota. 
descriptives /var=hsd1cs zhsd1. 
weight by hsusda. 
descriptives /var=hsd1cs zhsd1. 
weight by wstota. 
descriptives /var=wsd1cs zwsd1. 
weight by wsusda. 
descriptives /var=wsd1cs zwsd1. 
** Distribution of subgroup 
means to appropriate units :. 
sort cases by o1gp. 
match files file=* /table="mtch1a.sav" 
   /rename(h1gp=o1gp) /table="mtch1b.sav" /rename(w1gp=o1gp) /table="mtch1c.sav" 
  /rename(h1gp=o1gp) /table="mtch1d.sav" /rename(w1gp=o1gp) /by=o1gp. 
sort cases by o2gp.  
match files file=* /table="mtch2a.sav" /rename(h2gp=o2gp) /table="mtch2b.sav" 
   /rename(w2gp=o2gp) /table="mtch2c.sav" /rename(h2gp=o2gp) /table="mtch2d.sav" 
  /rename(w2gp=o2gp) /by=o2gp. 
sort cases by o3gp. 
match files file=* /table="mtch3a.sav" 
  /rename(h3gp=o3gp) /table="mtch3b.sav" /rename(w3gp=o3gp) /table="mtch3c.sav" 
  /rename(h3gp=o3gp) /table="mtch3d.sav" /rename(w3gp=o3gp) /by=o3gp. 
sort cases by o1gpst. 
match files file=* /table="mtch4c.sav" /rename(h1gpst=o1gpst) /table="mtch4d.sav" 
  /rename(w1gpst=o1gpst) /by=o1gpst. sort cases by o2gpst. match files file=* /table="mtch5c.sav" 
  /rename(h2gpst=o2gpst) /table="mtch5d.sav" /rename(w2gpst=o2gpst) /by=o2gpst. 
sort cases by o3gpst. 
match files file=* /table="mtch6c.sav" /rename(h3gpst=o3gpst) 
  /table="mtch6d.sav" /rename(w3gpst=o3gpst) /by=o3gpst. 
sort cases by occ. 
match files file=* /table="mtch7c.sav" /rename(hocc=occ) /table="mtch7d.sav" /rename(wocc=occ) /by=occ. 
sav out="indexandmeans.sav". 


Return to Attributing scores


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