条形图的位置

The position of the bar plot

我有以下代码图:

graph bar mean_positive, over(agegroup)

如何生成左侧为 YA、中间为 MA、右侧为 OA 的条形图?

bar plot

我们假设agegroup是一个字符串变量,在这种情况下

label def agegroup 1 YA 2 MA 3 OA 
encode agegroup, gen(age) label(agegroup) 

将按顺序整理您的类别,您可以使用 age 再试一次。现在是减少隐晦和使用更长的标签甚至给出确切年龄限制的好时机。

另一种猜测是您的数值变量的值标签顺序不正确,在这种情况下,首先到达 recode