UCSC Lab 10
Applying Weights
Purpose
- To Practice applying weights to survey data
- To Use the Weight command to enter published tables into SPSS
Main Points
- The samples from which survey data are collected often do not match the population they are intended to represent.
- Researchers therefore often weight their data for analysis.
- Data sets often contain one of more data weights for use in analysis.
- Consulting the codebook will provide information on the appropriate .weights to use
- The SPSS command is: Weight by
- With PPIC data the appropriate variable is weight
- In the ANES the appropriate variable is weight_full
Example 1
Data Set
ANES2012
Syntax
*Weighting the Data*. weight by weight_full. *Identifying EconEq Index Items*. missing values cses_govtact (-9 thru -6). fre var=cses_govtact /statistics stdev skew kurtosis. recode cses_govtact (1=1) (2=.75) (3= .5) (4= .25) (5=0) into eceq1. fre var eceq1. missing values ineqinc_ineqreduc (-9 thru -6). fre var ineqic_ineqreduc. recode ineqinc_ineqreduc (1=1) (2=0) (3= .5) into eceq3. fre var eceq3. missing values guarpr_self (-9 thru -2). recode guarpr_self (1=1) (2=.832) (3= .666) (4= .5) (5= .332) (6= .166) (7=0) into eceq5. fre var guarpr_self eceq5. *Constructing the Index*. compute RawIndex = eceq1 + eceq3 + eceq5. fre var RawIndex /statistics = mean median stddev skew kurtosis. *Recoding the Index*. recode RawIndex (0 thru 1.00 =1) (1.01 thru 1.85 =2) (1.86 thru 3 = 3)into IEcEq3. *Creating an indicator of Party Identification*. missing values pid_self (-9 thru 0, 5). fre var pid_self. missing values pid_x (-2). recode pid_self (1=1) (3 = .5) (2=0) into pid. value labels pid 1 'Dem' .5 'Ind' 0 'Rep'. *Crosstabulation of IEcEq3 by pid*. crosstabs tables = IEcEq3 by pid /cells = column count /statistics = phi btau.
Crosstabulation of support for action toward Income Equality by Partisan Identity
IEcEq3 | Partisan Identification | |||||
Repub | Ind | Democ | ||||
Support for Government Action toward Income Equality |
||||||
low | 66.3% | 36.7% | 14.9% | |||
med | 20.2% | 34.3% | 37.1% | |||
hi | 13.5% | 29.0% | 48.0% | |||
N = | (1403) | (1629) | (1746) |
Cramer’s V =.311
Taub = .377
Interpretation
These results differ somewhat from those reported in Lab 9.
These figures more closely represent the population values than those reported in Lab 9.
Example 2
Entering Published crosstabulations into SPSS
- Another use of the Weight command is to enter crosstabulated data.
- This is handy when you wish to calculate measures of association or statistical significance for a published crosstabulation.
- On the data list command the variable names are listed DV first and IV second. A third variable called count represents the number of cases in a cell.
- The cell entries are entered using the coordinates for the table. The first number defines the row, the second defines the column. The third number is the number of cases in the cell defined by the row and column numbers.
- Variable labels and value labels are entered as usual.
- The weight command tells SPSS how many cases to put in the cells.
- The crosstabulation command follows the usual pattern.
- Pasting this syntax into a new syntax window will produce the crosstabulation and summary statistics.
Entering Crosstabulated Data
(Using data from a paper under review at CJPS)
*Aboriginal Attitudes Paper for CJPS*. data list free / influence group count. begin data. 1 1 19 1 2 330 2 1 25 2 2 525 3 1 20 3 2 420 4 1 32 4 2 225 end data. variable labels influence 'undue influence' group 'group'. value labels influence 1 'Str Agree' 2 'Some Agree' 3 'Some Disagree' 4 'Str Disagree'. value labels group 1 'Aborig' 2 'not'. weight by count. crosstabs tables = influence by group /cells = column count /statistics = all.