查看原文
其他

【收藏】stata常见绘图一览表

2017-07-31 大秦学术 计量经济学服务中心
导读:

Stata具有优良的图形绘制功能,由于绘制图形方面的强大功能,也使得stata越来越受大众喜爱。可通过图形命令,绘制出各式各样的图形。




 help graph


这个命令,可以对stata各种图形进行学习。


       graph twoway            scatterplots, line plots, etc.

        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 命令,则可以延伸出来很多图形,包括散点图、折线图、饼图等。

命令用法为:


 [graph] twoway plot [if] [in] [, twoway_options]

where the syntax of plot is

 [(] plottype varlist ..., options [)] [||]


 plottype介绍如下:


     scatter               scatterplot

    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


菜单操作为:


 Graphics > Twoway graph (scatter, line, etc.)

  


Definition


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:


  sysuse uslifeexp2

. list in 1/8     


结果如下



其他命令如下:


 twoway scatter le year

 twoway line le year

 twoway connected le year

 twoway (scatter le year) (lfit le year)



分别对应如下图:




scheme


The graph above was produced using the economist scheme, which has with a look similar to that used by The Economist magazine.


操作步骤如下:







graphs




推荐阅读

研究生可以问导师的八件事,也是指导教师会帮你做的八件事

本、硕、博区别的“兔子理论”

此文在手,外文文献无忧!

经济学博士生论文写作指南

精选推荐| 一个研究生导师的肺腑之言

复旦大学博导彭慧胜:如果再读一次研究生

世界名牌大学课件下载地址,很难才弄到的!非常有用...

陆铭:写给不想做学术的你

在论文中如何交代你的“研究方法”?

颜宁央视“开讲”:人生的意义在于你为世界留下什么



·

·

·

END


l 计量经济学服务中心 l

计量经济学服务中心

更懂计量,更懂你

回复关键词:微信群,进入中心科研社群

学术QQ群:593977756(500人大群)

品牌网站:www.aiwanning.com

您可能也对以下帖子感兴趣

文章有问题?点此查看未经处理的缓存