Stata/图形
外观
< Stata
. clear . set obs 100 obs was 0, now 100 . gen id = _n . gen a = invnorm(uniform()) . gen b = invnorm(uniform()) + a . gen c = invnorm(uniform()) - 2*a . sc b c a, msymbol(sh oh) mcolor(cranberry green)
clear set obs 100 gen x = invnorm(uniform()) gen y = invnorm(uniform()) + x tw (sc y x)(lfit y x) tw (sc y x, msymbol(X))(lfit y x) tw (sc y x, msymbol(D))(lfit y x) tw (sc y x, msymbol(T))(lfit y x) tw (sc y x, msymbol(S))(lfit y x) tw (sc y x, msymbol(+))(lfit y x) tw (sc y x, msymbol(p))(lfit y x) tw (sc y x, msymbol(oh))(lfit y x) tw (sc y x, msymbol(sh))(lfit y x)
标准误差条形图非常适合显示置信区间。
. clear . set obs 100 obs was 0, now 100 . gen id = _n . expand 10 (900 observations created) . gen u = id/30 + invnorm(uniform()) . collapse (mean) mean = u (sd) sd = u, by(id) . local s = invnorm(.975) * 97,5 percentile of the normal distribution . serrbar mean sd id , scale(`s')
- 符号列表
. palette symbolpalette
查询图形提供所有设置。
. query graphics Graphics settings set graphics on set scheme vg_s2c set printcolor automatic may be automatic, asis, gs1, gs2, gs3 set copycolor automatic may be automatic, asis, gs1, gs2, gs3 set macgphengine quartz may be quartz or quickdraw set piccomments on
- 方案定义了图形的总体外观。
- 您可以在 Stata 图形的视觉指南网站上下载更多方案
. net from http://www.stata-press.com/data/vgsg2/ . net install vgsg2
您可以使用图形导出命令将图形导出为 png、jpg、ps 或 pdf 格式。
. tw sc y x . gr export graph.png, replace
请查看 h gr export 以查看所有可用图形设备的列表。
您也可以使用图形保存命令将图形存储在 Stata 图形格式中。此格式只能由 Stata 读取。