Hi,
I've written code to produce a bar graph that shows the mean of a score by education level. I'd like to make sure the y-axis labels are from the lowest level of education to the highest, i.e. from less than high school, high school, some college, college, and more than 4 years of college. Is there any way I could do this regardless of the mean value of the score?
Kindly find my code below:
gen education_level="Less than high school" if yearsofschooling<9
replace education_level="High school" if yearsofschooling==10
replace education_level="Some college" if yearsofschooling>10 & yearsofschooling<14
replace education_level="College" if yearsofschooling==14
replace education_level="More than 4 years of college" if yearsofschooling>14
graph bar (mean) score [weight=employment], over(education_level)
Thanks in advance!
I've written code to produce a bar graph that shows the mean of a score by education level. I'd like to make sure the y-axis labels are from the lowest level of education to the highest, i.e. from less than high school, high school, some college, college, and more than 4 years of college. Is there any way I could do this regardless of the mean value of the score?
Kindly find my code below:
gen education_level="Less than high school" if yearsofschooling<9
replace education_level="High school" if yearsofschooling==10
replace education_level="Some college" if yearsofschooling>10 & yearsofschooling<14
replace education_level="College" if yearsofschooling==14
replace education_level="More than 4 years of college" if yearsofschooling>14
graph bar (mean) score [weight=employment], over(education_level)
Thanks in advance!

Comment