Hi, I'm trying to create a box plot for two variables: family value score and sex. However, I find if one of the categories of variable = 0 when I use the command "relabel", the command doesn't work. For example, here 0 = female and 1 = male. The plot can not label female (see the image above). However, if there is no 0 in the categorical variables, these command works very well. For example, here I have five age groups (see the image below).
Code:
graph box tradition_family_score, over(sex, relabel(0 "Female" 1 "Male") label(labsize(small))) ytitle( /// "Family Values (High: traditional. Low: non-traditional)"
graph box tradition_family_score, over(age_group, relabel(1 "64-" 2 "65-69" 3 "70-74" 4 "75-79" 5 "80+") label(labsize(small))) ytitle( /// "Family Values (High: traditional. Low: non-traditional)")
Code:
graph box tradition_family_score, over(sex, relabel(0 "Female" 1 "Male") label(labsize(small))) ytitle( /// "Family Values (High: traditional. Low: non-traditional)"
Comment