Support #1859
opensample size loss due to weighting
100%
Description
Hi,
I am aware that weighting will affect and alter the sample size of the analysis, however, I am working with a pooled sample of participants from wave 3-6 and when I specify a weighted model my sample drops from ~45k to 27k. This seems quite significant, particularly once I start to investigate subgroup characterstics..
Would you be able to confirm whether a drop by ~20k is normal once weighting is applied ( ai am using the longitudinal wave f weight "f_indinub_lw" / whether the below STATA code makes you think it is instead an error with my coding?
STATA CODE:
//Open wave 6:
use f_hidp f_psu f_strata pidp f_sex_dv f_age_dv f_indinub_lw using "$inpath\f_indresp", clear
save "test", replace
foreach w in c d e {
// Extract the variables needed
    use "$inpath/`w'_indresp", clear
    isvar pidp `w'_addrmov_dv `w'_adcts `w'_distmov_dv `w'_mvyr `w'_mvever `w'_plnowy4 
    keep `r(varlist)'
	// save each wave specific file
    save `w'junk.dta, replace
}
	// Open the file for wave f and then add the rest of the wave specific files
use "test", clear
foreach w in c d e {
    merge 1:1 pidp using `w'junk.dta
    drop _merge
    }
save "test", replace
// get rid of unwanted temporary files
foreach w in c d e  {
    erase `w'junk.dta
}
mvdecode _all, mv(-9/-1)
//I only want those with data at wave 6 
drop if f_hidp==.
tabulate f_sex_dv // -> n= 45,186
svyset f_psu , strata(f_strata) singleunit(scaled)|| pidp, weight(f_indinub_lw)
svy: tabulate f_sex_dv, count col // -> n=27,094