** CALCULATION OF POPULATION WEIGHTS FOR LASA-WAVES.
** EXAMPLE: LASAH.
*Merge lasaz002, lasaz004 and lasaz008 into one file.
match files /file = 'pad\LASAZ002.SAV'
/file = 'pad\LASAZ004.SAV'
/file = 'pad\LASAZ008.SAV'
/by respnr
/keep respnr hresult sex hage.
** Select the cases for which data are from H wave (data collected in 2011-2012).
** N.B. If your analytic sample includes fewer participants, you need to select this sample, and calculate the weights for it.
FILTER OFF.
USE ALL.
SELECT IF (hresult = 5).
EXECUTE.
desc hage.
** Recode hage into 5-year categories, as population weights are used for 5-year age categories.
** Minimum age is 63.79; participants aged up to 65 are added to the 70-minus category.
** Maximum age is 100.6; participants aged 95 and over are defined in a separate category 95+.
** It is important that you assign high numbers as codes to the new categories, because in the next step you multiply these by 1 and 2 (the sex codes), and the results of the multiplication should not overlap.
compute hlft= hage.
recode hlft (LOWEST thru 70=65) (70 thru 75 = 70)
(75 thru 80 = 75) (80 thru 85 = 80) (85 thru 90=85)
(90 thru 95=90) (95 thru highest = 95).
value lab hlft 65 '64-70' 70 '70-75' 75 '75-80' 80 '80-85'
85 '85-90' 90 '90-95' 95 '95+'.
fre hlft.
** Preparation for non-parametric test to examine the deviation of the sex-age distribution in LASA ("observed frequency) from the distribution in the Dutch population ("expected frequency").
** The expected frequencies are derived from Statistics Netherlands (population composition as of 01-01-2012 by sex and 5-year age group).
** Construct one variable hsexlft combining the 2x7 sex-age categories.
compute hsexlft = sex * hlft.
** This is the variable that you test against the population distribution ('expected' numbers).
** Note, that the first row of expected numbers contains the population numbers in successive age categories for men, and the second row contains the respective numbers for women.
npar test chisquare = hsexlft
/expected = 432989 310115 224507 144421 69526 20912 3376
441067 339638 282037 224161 146361 61381 15877.
** When the npar test is significant, the deviation of the sample distribution from the population distribution is significant.
** This test provides observed and expected numbers for each category.
** The quotients of these numbers constitute the sample weights for each sex-age category.
** This is how you calculate the weight variable hwsexlft.
compute hwsexlft = 0.
if (hsexlft = 65) hwsexlft = (1/(207 /242.6)).
if (hsexlft = 70) hwsexlft = (1/(168/173.8)).
if (hsexlft = 75) hwsexlft = (1/(102/125.8)).
if (hsexlft = 80) hwsexlft = (1/(94 / 80.9)).
if (hsexlft = 85) hwsexlft = (1/( 53 / 39.0)).
if (hsexlft = 90) hwsexlft = (1/( 16/ 11.7)).
if (hsexlft = 95) hwsexlft = (1/( 11 / 1.9)).
if (hsexlft = 130) hwsexlft = (1/(242/247.1)).
if (hsexlft = 140) hwsexlft = (1/(189 /190.3)).
if (hsexlft = 150) hwsexlft = (1/(148 /158.0)).
if (hsexlft = 160) hwsexlft = (1/(134/125.6)).
if (hsexlft = 170) hwsexlft = (1/( 93/ 82.0)).
if (hsexlft = 180) hwsexlft = (1/( 45 / 34.4)).
if (hsexlft = 190) hwsexlft = (1/( 20/ 8.9)).
** Check the calculation by applying the weight variable hwsexlft.
weight by hwsexlft.
cro tab sex by hlft.
** The cross table should show the weighted numbers.
** Be careful to switch the weight variable off, as soon as you do not need it anymore.
weight off.
desc hwsexlft.