我在stata中使用coefplot来绘制系数。我将两个图组合在一起,并希望使用不同的xscale。网页建议使用此选项:
byopts(xrescale)但是,此选项不允许用户指定的xscale.例如,我想用xscale(-0.1,0.5)指定一个子图,用xscale指定另一个子图( -0.1,0.1)。下面的代码没有实现我的目标。
coefplot (est1,label(Grade 5)) (est2,label(Grade 6)) ///
, bylabel("Chinese") xscale(r(-0.1,0.5)) || ///
(est3,label(Grade 5)) (est4,label(Grade 6)) ///
,bylabel("Math") xscale(r(-0.1,0.1)) ||, ///
keep(1.female) ///
yscale(off) graphregion(fcolor(white)) xscale(r(0,1)
titleg(0.1)) ///
xline(0, lwidth(vthin) lcolor(red)) ciopts(recast(rcap))
byopts(xrescale)发布于 2018-03-16 19:31:15
很难知道出了什么问题,因为我们没有您的数据、完整的或有效的代码,甚至没有实现您的目标的实际图表。
下面的可复制示例显示了每个子图中的自定义x轴范围:
sysuse auto, clear
eststo m1: reg price c.mpg
eststo m2: reg price c.weight
eststo m3: reg price i.foreign
coefplot (m1, xscale(range(-350 -50))) || (m2, xscale(range(1 3))) || (m3, xscale(range(-1200 2000))) ///
, drop(_cons) byopts(xrescale cols(3))图如下所示:

可能的诊断:
coefplot可能不会听取您的意见。如果不看到模型的输出,就无法判断。coefplot,这是一种修复方法。使用用户编写的命令,当您遇到问题时,这总是值得检查的。https://stackoverflow.com/questions/49302285
复制相似问题