楼主: 匿名
20368 212

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

121
niuniuyiwan 在职认证  发表于 2015-9-6 09:48:56
  1. //cpyxplot

  2. //Plots the cross product of the variables indicted in command



  3. ssc install cpyxplot


  4. sysuse auto, clear
  5. cpyxplot for \rep78 mpg turn length, graphregion(color(ltblue))
复制代码

graph.PNG



122
niuniuyiwan 在职认证  发表于 2015-9-6 09:50:43
  1. //beamplot

  2. //The seasaw way of looking at the data


  3. ssc install beamplot

  4. sysuse auto, clear
  5. beamplot mpg, by(foreign) over(rep78)
复制代码

graph.PNG



123
niuniuyiwan 在职认证  发表于 2015-9-7 16:17:21
  1. //hangroot-Distribution checking graph

  2. ssc install hangroot

  3. sysuse nlsw88, clear
  4. gen ln_w = ln(wage)
  5. reg ln_w grade age ttl_exp tenure
  6. predict resid, resid
  7. hangroot resid, bar
复制代码

Graph.png



124
niuniuyiwan 在职认证  发表于 2015-9-7 16:21:43
  1. //Radar Plot


  2. ssc install radar


  3. sysuse auto, clear

  4. radar make turn mpg trunk if foreign, title(Nice Radar graph) ///
  5. lc(red blue green) lw(*1 *2 *4) r(0 12 14 18 50)
复制代码

Graph.png


125
niuniuyiwan 在职认证  发表于 2015-9-7 19:26:51
  1. //byhist-Draws a binary variable next to each other for each bin width

  2. ssc install byhist


  3. sysuse auto, clear
  4. byhist mpg, by(foreign)
复制代码

Graph.png



126
niuniuyiwan 在职认证  发表于 2015-9-7 19:38:04
  1. //bihist-二元变量双向绘制(可调宽度)
  2. //修正后注意不是byhist
  3. ssc install bihist

  4. sysuse auto, clear
  5. bihist mpg, by(foreign)
复制代码

Graph.png



127
niuniuyiwan 在职认证  发表于 2015-9-7 19:41:24
  1. //plotmatrix-矩阵面积图

  2. ssc install plotmatrix

  3. sysuse auto
  4. reg price mpg trunk weight length turn, nocons
  5. mat regmat = e(V)
  6. plotmatrix, m(regmat) c(red) ylabel(,angle(0))
复制代码

Graph.png



128
niuniuyiwan 在职认证  发表于 2015-9-7 19:47:41
  1. //full_palette 调色板
  2. //修改后:追加clear all

  3. ssc install full_palette

  4. clear all
  5. full_palette
复制代码

Graph.png



129
niuniuyiwan 在职认证  发表于 2015-9-7 20:36:34
  1. //parea

  2. //(Windows only) Allows the use of patterns to fill in areas under graphs

  3. findit twoway_parea

  4. clear all
  5. sysuse auto, clear
  6. twoway parea d w, sort pattern(pattern9) || ///
  7. parea l w if w<=3600, sort pattern(pattern6) || ///
  8. parea l w if w>=3600, sort pattern(pattern4) ,legend(rows(1))
复制代码

Graph.png



130
niuniuyiwan 在职认证  发表于 2015-9-7 20:38:21
  1. //pieplot-Makes it easier to draw pie charts of categorical frequencies


  2. ssc install pieplot


  3. sysuse auto, clear

  4. pieplot rep78 foreign, sum plabelsubopts(size(*2)) ///
  5. pie(1, color(red*2)) pie(2, color(red)) ///
  6. pie(3, color(red*0.7)) pie(4, color(red*0.5)) ///
  7. pie(5, color(red*0.3)) legend(row(1)) name(pieplot)
复制代码

pieplot.png



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

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2025-12-31 22:17