Stata如何绘制带阴影的核密度图?

生成上图的Stata命令如下: *Figure: Shaded k-density functions * Packages required ssc install akdensity * Load data use "http://ds.epiman.cn/uploads/2022/06/density-shaded.dta", replace * Create variable used for graph sort beta_ gen rank = _n * Calculate parameters for graph ...

Stata 官方命令 serrbar

webuse grunfeld, clear 因为数据需要生成,生成时会覆盖原有数据,为此我们新建一个临时数据框,Stata代码如下: /*创建临时数据框并复制数据*/ frame copy default lian_g /*生成需要的数据并存至临时数据框*/ frame lian_g:statsby mean=r(mean) sd=r(sd) size=r(N), by(year):summarize invest ...

Stata如何生成带数据点的密度图?

绘制上图的Stata命令如下: * Figure: Density graph with data points global graph_opts title(, justification(left) color(black) span pos(11)) /// graphregion(color(white)) ylab(,angle(0) nogrid notick) xscale(noline) yscale(noline) yline(0 , lc(black)) /// xtit(,placement(left) ...

如何用Stata绘制箱线图?

绘制上图的Stata命令如下: * Figure: 10-25-50-75-90 percentile box plot global graph_opts1 bgcolor(white) graphregion(color(white)) legend(region(lc(none) fc(none))) /// ylab(,angle(0) nogrid) title(, justification(left) color(black) span pos(11)) subtitle(, justification(left)...

Stata绘制误差条形图(Stata官方命令)

webuse lbw frame copy default lian_lbw frame lian_lbw: statsby mean=r(mean) ub=r(ub) lb=r(lb) N=r(N), by(smoke) clear: ci mean bwt frame lian_lbw:local text1 = mean[1] frame lian_lbw:local text2 = mean[2] frame lian_lbw: twoway bar mean smoke, text(3200 0 " Mean:`text1' " ) te...