survey_regression
Runs weighted regression on complex survey data, combining plausible values and replicate-weight standard errors for accurate TIMSS/PISA-style achievement analysis.
Instructions
Weighted regression for complex survey data, with replicate-weight standard errors and plausible-value pooling (Rubin's rules, Barnard-Rubin degrees of freedom). Use this instead of regression for TIMSS/PISA-style data: passing a single plausible value to an ordinary regression ignores measurement uncertainty, which is often 10-20% of the total.
For achievement scores use plausible values, never a single score: pv_prefix='BSMMAT' expands to BSMMAT01..05 (TIMSS style), or pv_pattern='PV{i}MATH' expands to PV1MATH.. (PISA style). The output reports how much of the standard error comes from sampling versus measurement.
Give the design one of two ways: replicate_weights (existing columns — either a list of names or a prefix such as 'W_FSTURWT' that matches W_FSTURWT1..80), or jkzone + jkrep so JK2 replicates are built for you (TIMSS/PIRLS ship JKZONE and JKREP). method defaults to JK2 for constructed replicates and Fay for 60+ supplied columns, which is what PISA needs.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dv | No | Observed outcome column. Omit when using plausible values. | |
| fay | No | Fay factor when method='fay'. | |
| data | Yes | Dataset name in the session. | |
| jkrep | No | Jackknife replicate indicator column (TIMSS: JKREP). | |
| digits | No | Decimal places. | |
| jkzone | No | Jackknife zone column (TIMSS: JKZONE). | |
| method | No | Replication method: auto, jk2, jk1, brr or fay. | auto |
| weight | Yes | Final sampling weight column. | |
| formula | No | Right-hand side as a formula, e.g. '~ age + sex + age:sex'. Overrides `predictors`. | |
| pv_count | No | How many plausible values. | |
| pv_prefix | No | Plausible-value prefix for the outcome, e.g. 'BSMMAT'. | |
| predictors | No | Predictor columns. Interactions can be written as 'a:b'. | |
| pv_pattern | No | Plausible-value pattern with {i}, e.g. 'PV{i}MATH'. | |
| replicate_weights | No | Replicate weight columns, or a prefix matching them. |