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
Bootstrapping standard errors moves the p-value of a variable from 0.000 to 1.000Hi all,
To overcome the generated regressor problem, I perform bootstrapping to correct the standar…
Quintile graph as bar chartHi all,
I'm new with stata and learning to visualize data in stata. I have some issue with bar graph…
Whether paired variable reduction is difference between groupsI have two variables, triglyceride before and after treatment.
So I run the paired t test to see if…
Difficulties installing outreg2I am using Stata 14. I typed: ssc install outreg2, followed the link to outreg2 and got the followin…
Converting 5-year interval to yearly panel dataDear Statalisters,
I would like to insert the missing years in a large multi-country five-year inter…
Subscribe to:
Post Comments (Atom)
0 Response to twoway connected line graph with multiple if statement
Post a Comment