Project

General

Profile

Actions

Support #2154

open

Scaling weights for pooled calendar year analysis

Added by Emma Maun 7 days ago. Updated 1 day ago.

Status:
In Progress
Priority:
Normal
Category:
-
Start date:
09/19/2024
% Done:

10%


Description

Hello,

I have pooled data from waves 9 to 12 and am carrying out pooled cross-sectional analysis on people who subsequently died (just keeping their last wave of data). I would like to analyse the proportion of several variables across calendar years 2018-2020 and would like to check my strategy for creating and scaling the weights - I have used q14-16 in the weighting paper 2024. I think I need to both ensure yr1 and yr2 of each calendar year contributes equally to estimates, and that each calendar year as a whole contributes equally to the estimates.

I am calculating the weights for the full pooled dataset before selecting my sample (the final sample is very small). I first applied a scaling factor to balance yr 1 and yr 2 for one of the calendar years (2019). I then used the scaled yr1 and yr2 2019 to scale the other calendar years for each 12 month period. My syntax is pasted below in case helpful, please could you let me know if this is the right way to ensure pooled calendar year data is properly weighted?

With thanks,
Emma

**
*generate scaled self-completion weight for yearly analysis, using 2019 as the base for scaling.
ge wt_yr_scld=0 //scaled weight for analysis by calendar year

replace wt_yr_scld=indscui_xw if wave==10 & (month>=13 & month<=24) //2019 for wave 10 - for scaling period months 13-24 in other waves

ge ind=1 //generate variable to scale the weights - first to balance the yr 1 and yr 2
sum ind [aw=indscui_xw] if wave==10 & (month>=1 & month<=12)
gen awtdtot=r(sum_w) //weighted total for wave 10 mths 1-12
sum ind [aw=indscui_xw] if wave==11 & (month>=1 & month<=12)
gen bwtdtot=r(sum_w) //weighted total for wave 11 mths 1-12

replace wt_yr_scld=indscui_xw*(awtdtot/bwtdtot) if wave==11 & (month>=1 & month<=12) //2019 in wave 11 - upweighted so yr2 weighted in same way as in wave 10, so it contributes as much to estimates.

*checking syntax
sum ind [aw=indscui_xw] if wave==10 & (month>=1 & month<=12)
sum ind [aw=wt_yr_scld] if wave==11 & (month>=1 & month<=12)

*use the scaled calendar year weights for 2019 to generate for the other calendar year weights so all contribute equally
drop ind awtdtot bwtdtot

ge ind=1
sum ind [aw=wt_yr_scld] if wave==11 & (month>=1 & month<=12)
gen awtdtot=r(sum_w) //calendar year 2019 yr2 scaled
sum ind [aw=wt_yr_scld] if wave==10 & (month>=13 & month<=24)
gen dwtdtot=r(sum_w) //calendar year 2019 yr1 scaled

*generate the remaining weighted totals for each 12 month period for scaling - first months 1-12 and then 13-24
sum ind [aw=indscui_xw] if wave==10 & (month>=1 & month<=12)
gen bwtdtot=r(sum_w) //weighted total wave 10 mths 1-12 (2018)
sum ind [aw=indscui_xw] if wave==12 & (month>=1 & month<=12)
gen cwtdtot=r(sum_w) //weighted total wave 12 mths 1-12 (2020)

sum ind [aw=indscui_xw] if wave==9 & (month>=13 & month<=24)
gen ewtdtot=r(sum_w) //weighted total wave 9 mths 13-24 (2018)
sum ind [aw=indscui_xw] if wave==11 & (month>=13 & month<=24)
gen fwtdtot=r(sum_w) //weighted total wave 11 mths 13-24 (2020)

scale each 12 month period to the same 12 month period in 2019, first for months 1-12 then 13-24
replace wt_yr_scld=indscui_xw
(awtdtot/bwtdtot) if wave==10 & (month>=1 & month<=12) //scaled weight wave 10 mths 1-12 = 2018
replace wt_yr_scld=indscui_xw*(awtdtot/cwtdtot) if wave==12 & (month>=1 & month<=12) //scaled weight wave 12 mths 1-12 = 2020
replace wt_yr_scld=indscui_xw*(dwtdtot/ewtdtot) if wave==9 & (month>=13 & month<=24) //scaled weight wave 9 mths 13-24 = 2018
replace wt_yr_scld=indscui_xw*(dwtdtot/fwtdtot) if wave==11 & (month>=13 & month<=24) //scaled weight wave 11 mths 13-24 = 2020

*checking
sum ind [aw=indscui_xw] if (wave==9 & (month>=13 & month<=24)) | (wave==10 & (month>=1 & month<=12)) //2018 not scaled
sum ind [aw=wt_yr_scld] if (wave==9 & (month>=13 & month<=24)) | (wave==10 & (month>=1 & month<=12)) //2018

sum ind [aw=indscui_xw] if (wave==10 & (month>=13 & month<=24)) | (wave==11 & (month>=1 & month<=12) ) //2019 not scaled
sum ind [aw=wt_yr_scld] if (wave==10 & (month>=13 & month<=24)) | (wave==11 & (month>=1 & month<=12) ) //2019

sum ind [aw=indscui_xw] if (wave==11 & (month>=13 & month<=24)) | (wave==12 & (month>=1 & month<=12)) //2020 not scaled
sum ind [aw=wt_yr_scld] if (wave==11 & (month>=13 & month<=24)) | (wave==12 & (month>=1 & month<=12)) //2020

Actions

Also available in: Atom PDF