Case weight (frequency weight and survey weight)
In brief
A case weight is a column of numbers that says how strongly each row counts. It applies to all analyses of a project. It is set on the "Data" page (button "Case weight"); afterwards it appears in the header next to the project name, under every result at "Calculated" and in the report. No chip in the header means the project is unweighted.
Two kinds
- Frequency weight: the row stands for several identical cases (3 means three times). The numbers are whole numbers. The number of cases is the sum of the weights (N); tests calculate as if the cases really occurred that often. In Stata: fweight.
- Survey weight: the number adjusts for respondents having been selected with different probabilities (the inverse of the selection probability; also called design or sampling weight). The sample still has n people. In Stata: pweight.
A third kind, the analytic weight (aweight) for weighted least squares, is not offered by Statable. Entering it as a frequency gives wrong standard errors.
What Statable does with it
- Frequency weight: methods that handle weights correctly calculate weighted: frequencies and statistics, crosstab with chi-square, group comparison (t test, analysis of variance), Pearson correlation, linear regression, principal components and Cohen's kappa. The results are the same as on a table in which every row appears as often as its weight says.
- The other methods are blocked as long as they do not handle weights correctly (rank tests, Spearman and Kendall, Cronbach's alpha, correlation matrix, logistic regression, repeated measures, bootstrap, survival times and more). Statable says why in one sentence. That is better than a number that counts each row only once. Charts that show individual rows (scatter, box, histogram, line chart) are blocked for the same reason; bars from weighted frequencies stay.
- Survey weight: Statable asks whether the people were drawn individually (not whole classes, schools or households, and without strata). If "Yes", Statable computes design-based with the R package survey: means and proportions with an interval, cross table with the Rao-Scott test, group comparison, linear and logistic regression. If "No or I do not know", the weighting is descriptive only (means, proportions, quartiles, only r for a correlation); p values, intervals and standard errors are then blocked because without the sampling design (strata, clusters) they would be too small. The effective sample size after Kish is shown as well.
- Single case, comparing cases, open answers, meta-analysis and data check work with single cases or studies. They only show the note "The case weight is not used here."
Why two kinds
Treating a survey weight as a frequency gives standard errors that depend on the size of the weights. Example: eight rows with the same values, the weights taken times 0.25, times 1 and times 10. The mean stays 4.33; the standard error by the frequency formula becomes 0.784, 0.347 and 0.106. The same data, three different "results". That is why Statable always asks for the kind and computes tests with a survey weight only design-based.
Design effect and SPSS
Statable computes the design effect without finite population correction (as R survey with deff = "replace"). SPSS corrects for the finite population and shows somewhat more (example apistrat: 1.210 versus SPSS 1.250).
Calculating weights from marginal distributions
In the "Case weight" dialog, besides "Choose an existing column", there is the route "Calculate weights (raking)": from known distributions of the population (for example gender and age group) Statable calculates a new column of survey weights. The question "drawn individually" follows. Details and pitfalls are in the article "Calculating weights (raking, marginal distributions)".
Case weight from an SPSS file or from a command
If an .sav file already carries an active case weight, or "WEIGHT BY …" is run in the commands, Statable asks: "What does … mean?" The kind is not stored in the .sav file, only the name of the column. No page calculates until it is answered. "Switch the case weight off" runs "WEIGHT OFF."
What is checked when setting it
- Rows with the case weight 0 and rows without a case weight are not counted (as in PSPP). Statable states the number of rows. A missing case weight is not the same as the case weight 1.
- Negative weights are an error. Decimals are an error for a frequency weight (never rounded); Statable then offers to use them as a survey weight.
- A sum of the weights far above the number of rows looks like a survey weight (scaling up to a population). Statable points that out.
- If the case weight changes, all pages become "outdated" and are calculated again. There is no case weight per page: otherwise weighted and unweighted numbers would be mixed in the report.
Aggregating
When aggregating, "Cases (weighted)" counts the sum of the weights per group and "Rows (unweighted)" counts the rows. Mean, sum, standard deviation and median are weighted. The new project with one row per group does not keep the case weight.
For specialists
PSPP WEIGHT BY: a whole-number weight w gives the same output as if the case were there w times; negative and missing weights count as 0; decimal weights are not rounded (N = 7.90 is possible). With a frequency weight Statable calculates quartiles like PSPP and the distribution card (type 6, ALGORITHM=COMPATIBLE); with survey weights it uses weights scaled to the number of rows and the HAVERAGE method of PSPP EXAMINE, so that they do not depend on the size of the weights. The variance has the denominator Σw − 1 and is only a description for survey weights. Effective sample size: (Σw)² / Σw² (Kish), design effect n / n_eff. With a sampling design, Taylor linearisation and the Rao-Scott test would be the right way (R survey); that is not part of Statable.
Sources
Lumley, T. (2010). Complex Surveys: A Guide to Analysis Using R. Wiley. Kish, L. (1965). Survey Sampling. Wiley. Kish, L. (1992). Weighting for unequal Pi. Journal of Official Statistics, 8(2), 183-200. IBM SPSS Statistics, WEIGHT command and the Complex Samples module (documentation). GNU PSPP 2.1.3, manual, section WEIGHT.