* SPSS Code for the British Election Campaign Study 1987. * CASR87 data. import file = 'C:\UKDA-2655-spss\spss\f655c.por' /keep = all. sort cases by BASE RESP. save outfile = 'C:\temp1.sav' /keep = all. * Pre-election Wave data (March/April 1987). import file = 'C:\UKDA-2655-spss\spss\f655f.por' /keep = all. sort cases by BASE RESP. frequencies variables = BASE RESP. frequencies variables = DYMTH. * All the interviews took place on dates prior to the three-week pre-campaign period. compute PRECAMPF = 1. frequencies variables = QD1C QD1L QD1A QD1N. recode QD1C QD1L QD1A QD1N (99 = 5). compute PRECAMP = 3. if (QD1C > 5 and QD1C > QD1L and QD1C > QD1A and QD1C > QD1N) PRECAMP = 1. if ((QD1L > 5 and QD1L > QD1C) or (QD1A > 5 and QD1A > QD1C) or (QD1N > 5 and QD1N > QD1C)) PRECAMP = 2. value labels PRECAMP 1 'Inclined to vote Conservative' 2 'Inclined to vote Labour, Alliance, or Nationalist' 3 "Not inclined to vote Conservative, Labour, Alliance, or Nationalist/Don't know". frequencies variables = PRECAMP. save outfile = 'C:\temp2.sav' /keep = all. * Wave Two data, that is, the first fortnight of the campaign. import file = 'C:\UKDA-2655-spss\spss\f655b.por' /keep = all. sort cases by BASE RESP. frequencies variables = BASE RESP. frequencies variables = DYMTH. compute PREELEF2 = 0. if (DYMTH >= 2105 and DYMTH <= 2905) PREELEF2 = 1. frequencies variables = QD1C QD1L QD1A QD1N. recode QD1C QD1L QD1A QD1N (0 = 0) (1 = 1) (2 = 2) (3 = 3) (4 = 4) (5 = 5) (6 = 6) (7 = 7) (8 = 8) (9 = 9) (10 = 10) (99 = 5) into QD1C2 QD1L2 QD1A2 QD1N2. frequencies variables = QD1C2 QD1L2 QD1A2 QD1N2. save outfile = 'C:\temp3.sav' /keep = all. * Wave Four data, that is, the second fortnight of the campaign. import file = 'C:\UKDA-2655-spss\spss\f655h.por' /keep = all. sort cases by BASE RESP. frequencies variables = BASE RESP. frequencies variables = DYMTH. * All the interviews took place on dates within the three-week pre-election period. compute PREELEF4 = 1. frequencies variables = QD1C QD1L QD1A QD1N. recode QD1C QD1L QD1A QD1N (0 = 0) (1 = 1) (2 = 2) (3 = 3) (4 = 4) (5 = 5) (6 = 6) (7 = 7) (8 = 8) (9 = 9) (10 = 10) (99 = 5) into QD1C4 QD1L4 QD1A4 QD1N4. frequencies variables = QD1C4 QD1L4 QD1A4 QD1N4. save outfile = 'C:\temp4.sav' /keep = all. * Post-election Wave data. import file = 'C:\UKDA-2655-spss\spss\f655d.por' /keep = all. sort cases by BASE RESP. frequencies variables = BASE RESP. frequencies variables = DYMTH. * All the interviews took place on dates after election day. frequencies variables = QD10. compute ELECTION = $sysmis. if (QD10 = 1) ELECTION = 1. if (QD10 >= 2 and QD10 <= 7) ELECTION = 2. if (QD10 = 0) ELECTION = 3. if (QD10 = 8 or QD10 = 9) ELECTION = $sysmis. value labels ELECTION 1 'Voted for the Conservative party' 2 'Voted for a party other than the Conservative party' 3 'Did not vote'. frequencies variables = ELECTION. * Merging the waves. match files file = 'C:\temp1.sav' /table = * /by BASE RESP /keep = all. match files file = * /table = 'C:\temp4.sav' /by BASE RESP /keep = all. match files file = * /table = 'C:\temp3.sav' /by BASE RESP /keep = all. match files file = * /table = 'C:\temp2.sav' /by BASE RESP /keep = all. * Combing QD1C2, QD1L2, QD1A2, and QD1N2 from Wave Two and QD1C4, QD1L4, QD1A4, and QD1N4 from Wave Four. frequencies variables = QD1C2 QD1L2 QD1A2 QD1N2 QD1C4 QD1L4 QD1A4 QD1N4. compute QD1C24 = $sysmis. if (missing(QD1C4) <> 1 and missing(QD1C2) <> 1 and PREELEF2 = 1) QD1C24 = (QD1C2 + QD1C4) / 2. if (missing(QD1C4) <> 1 and missing(QD1C2) <> 1 and PREELEF2 <> 1) QD1C24 = QD1C4. if (missing(QD1C4) <> 1 and missing(QD1C2) = 1) QD1C24 = QD1C4. if (missing(QD1C4) = 1 and missing(QD1C2) <> 1 and PREELEF2 = 1) QD1C24 = QD1C2. compute QD1L24 = $sysmis. if (missing(QD1L4) <> 1 and missing(QD1L2) <> 1 and PREELEF2 = 1) QD1L24 = (QD1L2 + QD1L4) / 2. if (missing(QD1L4) <> 1 and missing(QD1L2) <> 1 and PREELEF2 <> 1) QD1L24 = QD1L4. if (missing(QD1L4) <> 1 and missing(QD1L2) = 1) QD1L24 = QD1L4. if (missing(QD1L4) = 1 and missing(QD1L2) <> 1 and PREELEF2 = 1) QD1L24 = QD1L2. compute QD1A24 = $sysmis. if (missing(QD1A4) <> 1 and missing(QD1A2) <> 1 and PREELEF2 = 1) QD1A24 = (QD1A2 + QD1A4) / 2. if (missing(QD1A4) <> 1 and missing(QD1A2) <> 1 and PREELEF2 <> 1) QD1A24 = QD1A4. if (missing(QD1A4) <> 1 and missing(QD1A2) = 1) QD1A24 = QD1A4. if (missing(QD1A4) = 1 and missing(QD1A2) <> 1 and PREELEF2 = 1) QD1A24 = QD1A2. compute QD1N24 = $sysmis. if (missing(QD1N4) <> 1 and missing(QD1N2) <> 1 and PREELEF2 = 1) QD1N24 = (QD1N2 + QD1N4) / 2. if (missing(QD1N4) <> 1 and missing(QD1N2) <> 1 and PREELEF2 <> 1) QD1N24 = QD1N4. if (missing(QD1N4) <> 1 and missing(QD1N2) = 1) QD1N24 = QD1N4. if (missing(QD1N4) = 1 and missing(QD1N2) <> 1 and PREELEF2 = 1) QD1N24 = QD1N2. frequencies variables = QD1C24 QD1L24 QD1A24 QD1N24. compute PREELEC = 3. if (QD1C24 > 5 and QD1C24 > QD1L24 and QD1C24 > QD1A24 and QD1C24 > QD1N24) PREELEC = 1. if ((QD1L24 > 5 and QD1L24 > QD1C24) or (QD1A24 > 5 and QD1A24 > QD1C24) or (QD1N24 > 5 and QD1N24 > QD1C24)) PREELEC = 2. if (missing(QD1C24) = 1 or missing(QD1L24) = 1 or missing(QD1A24) = 1 or missing(QD1N24) = 1) PREELEC = $sysmis. value labels PREELEC 1 'Inclined to vote Conservative' 2 'Inclined to vote Labour, Alliance, or Nationalist' 3 "Not inclined to vote Conservative, Labour, Alliance, or Nationalist/Don't know". frequencies variables = PREELEC. * Preparing the data set for the creation of weights. compute TP = $sysmis. if (STRATA87 = 1111) TP = 1.6 * 100 / 99.9. if (STRATA87 = 1112) TP = 0.9 * 100 / 99.9. if (STRATA87 = 1121) TP = 1.3 * 100 / 99.9. if (STRATA87 = 1122) TP = 0.7 * 100 / 99.9. if (STRATA87 = 1211) TP = 6 * 100 / 99.9. if (STRATA87 = 1212) TP = 2.3 * 100 / 99.9. if (STRATA87 = 1221) TP = 2.9 * 100 / 99.9. if (STRATA87 = 1222) TP = 2 * 100 / 99.9. if (STRATA87 = 1311) TP = 1.6 * 100 / 99.9. if (STRATA87 = 1312) TP = 1.2 * 100 / 99.9. if (STRATA87 = 1321) TP = 1 * 100 / 99.9. if (STRATA87 = 1322) TP = 0.5 * 100 / 99.9. if (STRATA87 = 2111) TP = 2.6 * 100 / 99.9. if (STRATA87 = 2112) TP = 2.2 * 100 / 99.9. if (STRATA87 = 2121) TP = 4.2 * 100 / 99.9. if (STRATA87 = 2122) TP = 3.8 * 100 / 99.9. if (STRATA87 = 2211) TP = 4.4 * 100 / 99.9. if (STRATA87 = 2212) TP = 3.4 * 100 / 99.9. if (STRATA87 = 2221) TP = 7.9 * 100 / 99.9. if (STRATA87 = 2222) TP = 5.7 * 100 / 99.9. if (STRATA87 = 2311) TP = 2.1 * 100 / 99.9. if (STRATA87 = 2312) TP = 1.5 * 100 / 99.9. if (STRATA87 = 2321) TP = 3.7 * 100 / 99.9. if (STRATA87 = 2322) TP = 2.8 * 100 / 99.9. if (STRATA87 = 3111) TP = 2.5 * 100 / 99.9. if (STRATA87 = 3112) TP = 2.7 * 100 / 99.9. if (STRATA87 = 3121) TP = 1.3 * 100 / 99.9. if (STRATA87 = 3122) TP = 1.7 * 100 / 99.9. if (STRATA87 = 3211) TP = 4.3 * 100 / 99.9. if (STRATA87 = 3212) TP = 3.5 * 100 / 99.9. if (STRATA87 = 3221) TP = 5.1 * 100 / 99.9. if (STRATA87 = 3222) TP = 3.7 * 100 / 99.9. if (STRATA87 = 3311) TP = 2.6 * 100 / 99.9. if (STRATA87 = 3312) TP = 1.5 * 100 / 99.9. if (STRATA87 = 3321) TP = 2.9 * 100 / 99.9. if (STRATA87 = 3322) TP = 1.8 * 100 / 99.9. compute FLAG = 1. sort cases by STRATA87. save outfile = 'C:\temp5.sav' /keep = all. * Table 1 - Pre-campaign. get file = 'C:\temp5.sav' /keep = all. select if (missing(PRECAMP) <> 1). weight by BASEWT. aggregate outfile = 'C:\temp6.sav' /missing = columnwise /presorted /break = FLAG /FLAGN = N /FLAGNU = NU. get file = 'C:\temp5.sav' /keep = all. select if (missing(PRECAMP) <> 1). weight by BASEWT. aggregate outfile = 'C:\temp7.sav' /missing = columnwise /presorted /break = STRATA87 /STRATAN = N /STRATANU = NU. match files file = * /table = 'C:\temp7.sav' /by STRATA87 /keep = all. match files file = * /table = 'C:\temp6.sav' /by FLAG /keep = all. weight off. compute NEWWT = BASEWT * TP * FLAGN / (100 * STRATAN) * (FLAGNU / FLAGN). frequencies variables = STRATA87 PRECAMP. weight by NEWWT. frequencies variables = STRATA87 PRECAMP. weight off. * Table 1 - Pre-election. get file = 'C:\temp5.sav' /keep = all. select if (missing(PREELEC) <> 1). weight by BASEWT. aggregate outfile = 'C:\temp6.sav' /missing = columnwise /presorted /break = FLAG /FLAGN = N /FLAGNU = NU. get file = 'C:\temp5.sav' /keep = all. select if (missing(PREELEC) <> 1). weight by BASEWT. aggregate outfile = 'C:\temp7.sav' /missing = columnwise /presorted /break = STRATA87 /STRATAN = N /STRATANU = NU. match files file = * /table = 'C:\temp7.sav' /by STRATA87 /keep = all. match files file = * /table = 'C:\temp6.sav' /by FLAG /keep = all. weight off. compute NEWWT = BASEWT * TP * FLAGN / (100 * STRATAN) * (FLAGNU / FLAGN). frequencies variables = STRATA87 PREELEC. weight by NEWWT. frequencies variables = STRATA87 PREELEC. weight off. * Table 1 - Election. get file = 'C:\temp5.sav' /keep = all. select if (missing(ELECTION) <> 1). weight by BASEWT. aggregate outfile = 'C:\temp6.sav' /missing = columnwise /presorted /break = FLAG /FLAGN = N /FLAGNU = NU. get file = 'C:\temp5.sav' /keep = all. select if (missing(ELECTION) <> 1). weight by BASEWT. aggregate outfile = 'C:\temp7.sav' /missing = columnwise /presorted /break = STRATA87 /STRATAN = N /STRATANU = NU. match files file = * /table = 'C:\temp7.sav' /by STRATA87 /keep = all. match files file = * /table = 'C:\temp6.sav' /by FLAG /keep = all. weight off. compute NEWWT = BASEWT * TP * FLAGN / (100 * STRATAN) * (FLAGNU / FLAGN). frequencies variables = STRATA87 ELECTION. weight by NEWWT. frequencies variables = STRATA87 ELECTION. weight off. * Table 4. get file = 'C:\temp5.sav' /keep = all. select if (missing(PRECAMP) <> 1 and missing(PREELEC) <> 1 and missing(ELECTION) <> 1). weight by BASEWT. aggregate outfile = 'C:\temp6.sav' /missing = columnwise /presorted /break = FLAG /FLAGN = N /FLAGNU = NU. get file = 'C:\temp5.sav' /keep = all. select if (missing(PRECAMP) <> 1 and missing(PREELEC) <> 1 and missing(ELECTION) <> 1). weight by BASEWT. aggregate outfile = 'C:\temp7.sav' /missing = columnwise /presorted /break = STRATA87 /STRATAN = N /STRATANU = NU. match files file = * /table = 'C:\temp7.sav' /by STRATA87 /keep = all. match files file = * /table = 'C:\temp6.sav' /by FLAG /keep = all. weight off. compute NEWWT = BASEWT * TP * FLAGN / (100 * STRATAN) * (FLAGNU / FLAGN). frequencies variables = STRATA87 PRECAMP PREELEC ELECTION. weight by NEWWT. frequencies variables = STRATA87 PRECAMP PREELEC ELECTION. weight off. compute CEVI = $sysmis. if (PRECAMP = 1 and PREELEC = 1 and ELECTION = 1) CEVI = 1. if (PRECAMP = 1 and PREELEC = 1 and ELECTION = 3) CEVI = 1. if (PRECAMP = 1 and PREELEC = 1 and ELECTION = 2) CEVI = 1. if (PRECAMP = 1 and PREELEC = 3 and ELECTION = 1) CEVI = 3. if (PRECAMP = 1 and PREELEC = 3 and ELECTION = 3) CEVI = 2. if (PRECAMP = 1 and PREELEC = 3 and ELECTION = 2) CEVI = 2. if (PRECAMP = 1 and PREELEC = 2 and ELECTION = 1) CEVI = 3. if (PRECAMP = 1 and PREELEC = 2 and ELECTION = 3) CEVI = 3. if (PRECAMP = 1 and PREELEC = 2 and ELECTION = 2) CEVI = 2. if (PRECAMP = 3 and PREELEC = 1 and ELECTION = 1) CEVI = 2. if (PRECAMP = 3 and PREELEC = 1 and ELECTION = 3) CEVI = 3. if (PRECAMP = 3 and PREELEC = 1 and ELECTION = 2) CEVI = 3. if (PRECAMP = 3 and PREELEC = 3 and ELECTION = 1) CEVI = 1. if (PRECAMP = 3 and PREELEC = 3 and ELECTION = 3) CEVI = 1. if (PRECAMP = 3 and PREELEC = 3 and ELECTION = 2) CEVI = 1. if (PRECAMP = 3 and PREELEC = 2 and ELECTION = 1) CEVI = 3. if (PRECAMP = 3 and PREELEC = 2 and ELECTION = 3) CEVI = 3. if (PRECAMP = 3 and PREELEC = 2 and ELECTION = 2) CEVI = 2. if (PRECAMP = 2 and PREELEC = 1 and ELECTION = 1) CEVI = 2. if (PRECAMP = 2 and PREELEC = 1 and ELECTION = 3) CEVI = 3. if (PRECAMP = 2 and PREELEC = 1 and ELECTION = 2) CEVI = 3. if (PRECAMP = 2 and PREELEC = 3 and ELECTION = 1) CEVI = 2. if (PRECAMP = 2 and PREELEC = 3 and ELECTION = 3) CEVI = 2. if (PRECAMP = 2 and PREELEC = 3 and ELECTION = 2) CEVI = 3. if (PRECAMP = 2 and PREELEC = 2 and ELECTION = 1) CEVI = 1. if (PRECAMP = 2 and PREELEC = 2 and ELECTION = 3) CEVI = 1. if (PRECAMP = 2 and PREELEC = 2 and ELECTION = 2) CEVI = 1. compute VOTE = $sysmis. if (ELECTION = 1 or ELECTION = 2) VOTE = 1. if (ELECTION = 3) VOTE = 2. frequencies variables = CEVI VOTE. weight by NEWWT. frequencies variables = CEVI VOTE. weight off. weight by NEWWT. crosstabs table = VOTE by CEVI /cells = count column. weight off.