楼主: 匿名
20381 212

[Stata] [Stata] 如何添加直角坐标系及极坐标系及SDAS_绘图实例 [推广有奖]

141
niuniuyiwan 在职认证  发表于 2015-9-8 09:38:17
  1. *sparkline
  2. // sparkline graphs sparkline-type plots for one or more y
  3. // variables against a single x variable. Typically, plots for
  4. // different y variables or for different subsets of one y variable
  5. // are stacked vertically into one image.

  6. /*Requires: sparkline
  7. to download this program type the following on the Stata
  8. command line (if not already loaded):*/
  9. ssc install sparkline

  10. webuse grunfeld, clear

  11. sparkline invest year, by(company) extremes
复制代码

Graph.png



142
niuniuyiwan 在职认证  发表于 2015-9-8 10:02:14
  1. //cmogram
  2. /*cmogram graphs the means, medians, frequencies, or proportions
  3. of yvar, conditional on xvar.

  4. Requires: cmogram
  5. to download this program type the following on the Stata command
  6. line (if not already loaded):*/
  7. ssc install cmogram

  8. //To run the example: copy the following into a do file and run

  9. sysuse auto, clear

  10. cmogram mpg weight, histopts(bin(5)) lfit cutpoint(3250) ///
  11. lineat(3000 3250 3500) controls(price)
复制代码

cm_plot.png



143
niuniuyiwan 在职认证  发表于 2015-9-8 18:40:47
  1. //eclplot 文档修改后
  2. /*Plot estimates with confidence limits
  3. Requires: eclplot, parmby & sencode
  4. to download these programs type the following on the Stata command line (if not already loaded):*/
  5. ssc install eclplot
  6. findit parmest
  7. ssc install sencode


  8. sysuse auto, clear

  9. tabulate rep78, gene(rep78_)

  10. parmby "regress mpg rep78_*, noconst", by(foreign) label norestore

  11. sencode label if parm!="_cons", gene(parmlab)
  12. label var parmlab "Repair record 1978"

  13. label var estimate "Mean mileage (mpg)"
  14. eclplot estimate min95 max95 parmlab, eplot(bar) estopts(barwidth(0.25)) ///
  15. supby(foreign, ///
  16. spaceby(0.25)) xscale(range(0 6)) xlabel(1(1)5, angle(30))
复制代码

Graph.png



144
niuniuyiwan 在职认证  发表于 2015-9-8 18:42:10
  1. //Pareto plot-pdplot produces a Pareto dot plot


  2. ssc install pdplot

  3. sysuse auto, clear
  4. pdplot mpg
复制代码

Graph.png



145
niuniuyiwan 在职认证  发表于 2015-9-8 18:43:44
  1. //missingplot
  2. // Generates a graph of missing values


  3. ssc install missingplot

  4. webuse nlsw88, clear
  5. missingplot, var labels mlabcolor(blue ..)
复制代码

Graph.png



146
niuniuyiwan 在职认证  发表于 2015-9-8 21:21:14
  1. //Batplot-Produces a Bland-Altman plot when there is a relationship between paired differences and their average

  2. /*Requires: batplot
  3. to download this program type the following on the Stata command line (if not already loaded):*/
  4. ssc install batplot

  5. //To run the example: copy the following into a do file and run

  6. sysuse auto, clear

  7. batplot mpg turn, title(Agreement between mpg and turn) ///
  8. info valabel(make) notrend xlab(26(4)38) moptions(mlabp(9))
复制代码

Graph.png



147
niuniuyiwan 在职认证  发表于 2015-9-9 07:58:02
  1. //Pareto plot-pdplot produces a Pareto dot plot

  2. /*Requires: pdplot
  3. to download this program type the following on the Stata command
  4. line (if not already loaded):*/
  5. ssc install pdplot

  6. //To run the example: copy the following into a do file and run


  7. sysuse auto, clear
  8. pdplot mpg
复制代码

Graph.png



148
niuniuyiwan 在职认证  发表于 2015-9-9 08:01:16
  1. // Centred bar plots
  2. /*Centred bar plots shows absolute or relative frequencies of
  3. yvar as centred bar plots.

  4. Centred bar plots are often used in archaeology to show
  5. frequencies of different kinds of artefact at different
  6. levels or ages, sometimes under the title of battleship
  7. curves or battleship diagrams.

  8. Requires: cbarplot
  9. to download this program type the following on the Stata
  10. command line (if not already loaded):*/
  11. ssc install cbarplot



  12. clear
  13. input levels freqcores freqblanks freqtools
  14.     25 21 32 70
  15.     24 36 52 115
  16.     23 126 650 549
  17.     22 159 2342 1633
  18.     21 75 487 511
  19.     20 176 1090 912
  20.     19 132 713 578
  21.     18 46 374 266
  22.     17 550 6182 1541
  23.     16 76 846 349
  24.     15 17 182 51
  25.     14 4 51 14
  26.     13 29 228 130
  27.     12 135 2227 729
  28. end
  29. reshape long freq, i(levels) j(kind) string

  30. cbarplot levels kind [fw=freq], percent(levels) mlabsize(*.6)
复制代码

Graph.png



149
niuniuyiwan 在职认证  发表于 2015-9-9 08:06:12
  1. //Fractal- Generates fractals
  2. //修改后iter(3)改为4
  3. /*Requires: fractal
  4. to download this program type the following on the Stata
  5. command line (if not already loaded):*/
  6. ssc install fractal

  7. clear

  8. fractal  ,hs(0,.2,.3,.40,.5,.618,.75,.85,1.0)   ///
  9. vs(0,.25,.2,.35,.25,.516,.366,.42,.2) hr(0 100) ///
  10. vr(0 200) iter(4) savegraph

  11. graph combine _frctl1.gph _frctl2.gph _frctl3.gph _frctl4.gph
复制代码

Graph.png



150
niuniuyiwan 在职认证  发表于 2015-9-9 08:09:34
  1. //missingplot
  2. // Generates a graph of missing values

  3. /*Requires: missingplot
  4. to download this program type the following on the Stata
  5. command line (if not already loaded):*/
  6. ssc install missingplot

  7. webuse nlsw88, clear
  8. missingplot, var labels mlabcolor(blue ..)
复制代码

Graph.png



您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2026-1-1 04:02