I want to plot connected line graph to represent the before after pattern of a policy implemented in 2014.
I want to see the trend of gender(a dummy variable, male==0, female==1) in the expansionary state(which is another indicator variable, expansionary state==1 vs non expansionary state==0). So this is a nested if condition.
How do i incorporate this two conditions to plot a two way connected graph for the gender in the expansionary state?
My current code is the following which is giving an error as "invalid syntax"
by year gender, sort: egen mean_enroll=mean(enrollment)
twoway (connected mean_enroll year if gender==1, ms(O)) (connected mean_enroll year if gender==0, ms(Oh)), xline(2014) legend(label(1 "Female") label(2 "Male")) , by(expansionary_state)
Related Posts with twoway connected line graph with multiple if statement
Creating a binary varible from a date variableI would like to create a variable where there is only two variables (0=heating, 1=non-heating) I ha…
Save the residuals from a regression with industry and year fixed effectsDear Stata Users, I am trying to estimate a model with industry and year fixed effects with standar…
Metan/forest plot - multiple pooled analysis within 1 forest plotHi all, I want to present the results of some subgroup analysis. There are two potential effect mod…
Reverse coefficients after regression on ihs transformed netwealthDear Stata Forum, I am doing regressions with dependent var netwealth transformed with the hyperbol…
Minutes off in datetime formattingHello, I am working on a load profile with 30-minute invervals of electricity demand that I wish to…
Subscribe to:
Post Comments (Atom)
0 Response to twoway connected line graph with multiple if statement
Post a Comment