All-women factor in trend analysis [message #26284] |
Fri, 03 March 2023 09:44 |
Serala
Messages: 12 Registered: February 2023
|
Member |
|
|
Dear forum users,
I am planning to do a difference-in-differences analysis using Nepal DHS 2001, 2006, 2011, and 2016, the women's IR recode. I have appended the data to include all these survey rounds and I have identified a control group and treatment group. I am now trying to do a graphical analysis to see whether the treatment and control group have similar trends in women's educational and employment outcomes.
However, I just noticed that the 2001 NDHS is an ever-married sample while the other rounds are all-women samples. So my question is, how can I make the samples comparable, for example when looking at the trend in the total years of education for women? I assume I have to use the AWFACTE for education, but how? And what about employment outcomes? All help would be very much appreciated!
Best regards,
Serala
|
|
|
Re: All-women factor in trend analysis [message #26285 is a reply to message #26284] |
Fri, 03 March 2023 09:50 |
Serala
Messages: 12 Registered: February 2023
|
Member |
|
|
Below is a part of my stata code if that helps to understand my problem. AccessAboveMed=1 is my treatment group.
*Appending survey rounds*
use [2001 data]
gen sample=2001
append using [2006 data]
replace sample=2006 if missing(sample)
append using [2011 data]
replace sample=2011 if missing(sample)
append using [2016 data]
replace sample=2016 if missing(sample)
egen strata_ID = group(sample v022)
egen cluster_ID = group(sample v001)
*Survey setting*
svyset, clear
gen wt = v005/1000000
svyset [pw=wt], psu(cluster_ID) strata(strata_ID) singleunit(centered)
*Parallel trends test*
graph twoway (scatter v133 sample if AccessAboveMed==1, msymbol(T) mcolor(blue)) (scatter v133 sample if AccessAboveMed==0, msymbol(0) mcolor(orange)) (lfit v133 sample if AccessAboveMed==1 & sample<=2011, lcolor(blue)) (lfit v133 sample if AccessAboveMed==1 & sample>2011, lcolor(blue)) (lfit v133 sample if AccessAboveMed==0 & sample<=2011, lcolor(orange)) (lfit v133 sample if AccessAboveMed==0 & sample>2011, lcolor(orange) xline(2011) legend(order(1 "Treated" 2 "Control"))), yscale(range(0 10))
|
|
|
Re: All-women factor in trend analysis [message #26287 is a reply to message #26285] |
Fri, 03 March 2023 12:28 |
Bridgette-DHS
Messages: 3199 Registered: February 2013
|
Senior Member |
|
|
Following is a response from Senior DHS staff member, Tom Pullum:
I recommend that you not use the all-women factors at all, but instead construct a revised IR file for the 2001 survey (NP41), which can be handled like any other IR file. A program to do this is attached, and is set up for this specific survey. It contains many comments. Usually the marital status variable in the PR file is hv115, but in this survey it is sh08, so there is an exception for that. Let us know if you have any questions.
The all-women factors are not just a nuisance--they are calculated in an arbitrary way, based on single years of age, and are different for different covariates. The procedure suggested here is frankly much more defensible than using an ever-married IR file with all-women factors.
[Updated on: Mon, 24 April 2023 12:20] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
Re: All-women factor in trend analysis [message #26714 is a reply to message #26709] |
Fri, 21 April 2023 09:23 |
Bridgette-DHS
Messages: 3199 Registered: February 2013
|
Senior Member |
|
|
Following is a response from Senior DHS staff member, Tom Pullum:
I just looked, and my version of the constructed all-women file does include valid values of v005 for all women.
If nmw_file.dta includes v005 (it does for me and you say it does for you) then you need to check the following lines in the program:
quietly append using nmw_file.dta
* Check after the append to confirm the addition of many cases with NA
tab bidx_01,m
* re-calibrate v005 so the ratio of mean weights in this combined file is the same as in the PR file
* do not change the IR (emw) weights; instead, multiply the nmw weights (hv005) from the PR file by a factor
summarize v005 if nmw==1
scalar mean_wt_nmw=r(mean)
summarize v005 if nmw==0
scalar mean_wt_emw=r(mean)
* the ratio of mean weights, nmw to emw, in the combined file, is mean_wt_nmw/mean_wt_dmw
* need to multiply the nmw=1 weights by a factor so the ratio matches the ratio in the PR file
replace v005=v005*(mean_wt_emw/mean_wt_nmw)*mean_wt_ratio_nmw_to_emw if nmw==1
These lines work ok for me, but perhaps you are getting a warning of some kind or something else is happening with a default. I suggest that you insert "summarize v005" at several points, especially right after the "append" and see whether the number of cases "Obs" in the output stays constant and at the correct value from the beginning to the end of this section of the program. Hope you can figure it out.
|
|
|
|
Re: All-women factor in trend analysis [message #26728 is a reply to message #26724] |
Mon, 24 April 2023 12:19 |
Bridgette-DHS
Messages: 3199 Registered: February 2013
|
Senior Member |
|
|
Following is a response from Senior DHS staff member, Tom Pullum:
I apologize for an error in the version of the Stata program with a "3Mar2023" date. Please use the attached version, with today's date, "24Apr2023". The only change in the corrected version is that the two lines
scalar mean_wt_ratio_nmw_to_emw=mean_wt_emw/mean_wt_nmw
replace v005=v005*mean_wt_ratio_nmw_to_emw if nmw==1
should be used instead of the line "replace v005=v005*...... if nmw=1". That line had included mean_wt_ratio_nmw_to_emw but that scalar had not been defined. The program had correctly extracted the two means from the summarize commands and had assigned names to them, but I had not defined another scalar to be the ratio of those two means. Apparently I was doing some final streamlining of the program. The mistake is essentially a typo but a serious one.
If you make that substitution the program should work ok. I'm only posting a revised version, with today's date, in case someone else wants to use the program. Thanks for checking and seeing that v005 was missing for the never-married women. That would have a serious effect on any analysis!
[Updated on: Mon, 01 May 2023 14:17] Report message to a moderator
|
|
|
|