【收藏】stata常见绘图一览表
Stata具有优良的图形绘制功能,由于绘制图形方面的强大功能,也使得stata越来越受大众喜爱。可通过图形命令,绘制出各式各样的图形。
这个命令,可以对stata各种图形进行学习。
graph matrix scatterplot matrices
graph bar bar charts
graph dot dot charts
graph box box-and-whisker plots
graph pie pie charts
other more commands to draw statistical graphs
而对于常见的graph twoway 命令,则可以延伸出来很多图形,包括散点图、折线图、饼图等。
命令用法为:
where the syntax of plot is
[(] plottype varlist ..., options [)] [||]
plottype介绍如下:
line line plot
connected connected-line plot
scatteri scatter with immediate arguments
area line plot with shading
bar bar plot
spike spike plot
dropline dropline plot
dot dot plot
rarea range plot with area shading
rbar range plot with bars
rspike range plot with spikes
rcap range plot with capped spikes
rcapsym range plot with spikes capped with symbols
rscatter range plot with markers
rline range plot with lines
rconnected range plot with lines and markers
pcspike paired-coordinate plot with spikes
pccapsym paired-coordinate plot with spikes capped with symbols
pcarrow paired-coordinate plot with arrows
pcbarrow paired-coordinate plot with arrows having two heads
pcscatter paired-coordinate plot with markers
pci pcspike with immediate arguments
pcarrowi pcarrow with immediate arguments
tsline time-series plot
tsrline time-series range plot
contour contour plot with filled areas
contourline contour lines plot
mband median-band line plot
mspline spline line plot
lowess LOWESS line plot
lfit linear prediction plot
qfit quadratic prediction plot
fpfit fractional polynomial plot
lfitci linear prediction plot with CIs
qfitci quadratic prediction plot with CIs
fpfitci fractional polynomial plot with CIs
function line plot of function
histogram histogram plot
kdensity kernel density plot
lpoly local polynomial smooth plot
lpolyci local polynomial smooth plot with CIs
菜单操作为:
twoway is a family of plots, all of which fit on numeric y and x scales.
Twoway graphs show the relationship between numeric data. Say that we have data on life expectancy in the United States between 1900 and 1940:
. list in 1/8
结果如下
其他命令如下:
twoway scatter le year
twoway line le year
twoway connected le year
twoway (scatter le year) (lfit le year)
分别对应如下图:
The graph above was produced using the economist scheme, which has with a look similar to that used by The Economist magazine.
操作步骤如下: