【问题】
使用分组命令画散点图时,按照一般标题命令输入后,标题自动分配到了两个小组内,
scatter tier1 tier2 unhealthy ragey, by(female, rows(1)) ///
title("健康随年龄增长的变化趋势:韩国", color(black)) ///
legend(order(1 "最健康" 2 "一般健康" 3 "不健康") ///
rows(1) ring(0) position(12) bexpand) ///
ytitle("健康水平%") ///
xtitle("年龄") ///
scheme( s1color)
结果如下图所示:
我想要一个总标题,因此翻看了STATA用户手册后找到了解决方法:
【新命令】
scatter tier1 tier2 unhealthy ragey, by(female, title("健康随年龄增长的变化趋势:韩国", color(black)) rows(1)) ///
legend(order(1 "最健康" 2 "一般健康" 3 "不健康") ///
rows(1) ring(0) position(12) bexpand) ///
ytitle("健康水平%") ///
xtitle("年龄") ///
scheme( s1color)
最终效果:
❓但是目前仍然存有一个疑问,如何用命令删除左下角的“graphs by female”?
✅找到解决方法了!
#去掉图中的“graphs by XX”
//Put the note("") inside the by():
【原】stripplot L2, subtitle("") note("") over(emot4cat) by(situs) bar(level(95)) cumulate scheme(s1color) ytitle("")
【改】stripplot L2, subtitle("") over(emot4cat) by(situs, note("")) bar(level(95)) cumulate scheme(s1color) ytitle("")