I have data for individuals showing whether they received a particular service, by quarter and by district (11 districts in total). The 'service' variable is binary (0=did not receive service, 1=received service). I want to create a scatter plot of the % of people who received the service by quarter, with the points connected by lines, and a different line for each district. I typed the following:
egen display = mean(100*service), by(quarter district)
separate display, by(district) veryshortlabel
scatter display? quarter, connect(direct)
The scatter plot is correct, but the points are only connected for the first of the 11 districts (display1). How can I get the connect(direct) option to apply to all 11 districts (display1-display11)?
(I don't want to create a line graph as a couple of districts only have data for one quarter. They won't appear on a line graph as individual data points are not displayed and the msymbol option doesn't apply.)
Thank you!
egen display = mean(100*service), by(quarter district)
separate display, by(district) veryshortlabel
scatter display? quarter, connect(direct)
The scatter plot is correct, but the points are only connected for the first of the 11 districts (display1). How can I get the connect(direct) option to apply to all 11 districts (display1-display11)?
(I don't want to create a line graph as a couple of districts only have data for one quarter. They won't appear on a line graph as individual data points are not displayed and the msymbol option doesn't apply.)
Thank you!
Comment