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
Estimation of margins after estimates use e(sample) does not identity the estimation sampleHi list, I am currently working on a project that envolves me using the Mixed command. The model in…
Error (603)Hello everyone! I am having this problem (look in the attached file) during an attempt to install fr…
Remove all ID duplicates except the last.Hi. I am pretty new to STATA and I find myself struggling with a dataset that I have been working on…
Event study graphDear all, I have this dataset Code: * Example generated by -dataex-. To install: ssc install data…
lower number of observation after logit on mi dataDear all, I have a set of variables with missing data. total of 6000 observations and 49 variables. …
Subscribe to:
Post Comments (Atom)
0 Response to twoway connected line graph with multiple if statement
Post a Comment