楼主: 匿名
20385 212

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

161
niuniuyiwan 在职认证  发表于 2015-9-9 09:45:55
  1. //strippplot

  2. ssc install stripplot

  3. sysuse bplong, clear

  4. egen group = group(age sex), label

  5. stripplot bp*, bar over(when) by(group, compact col(1) note("")) ///
  6. ysc(reverse) subtitle(, pos(9) ring(1) nobexpand bcolor(none) ///
  7. placement(e)) ytitle("") xtitle(Blood pressure (mm Hg))

  8. //From striplot help:Nick cox
复制代码

Graph.png



已有 1 人评分经验 论坛币 学术水平 热心指数 信用等级 收起 理由
xddlovejiao1314 + 50 + 20 + 1 + 1 + 1 精彩帖子

总评分: 经验 + 50  论坛币 + 20  学术水平 + 1  热心指数 + 1  信用等级 + 1   查看全部评分

162
niuniuyiwan 在职认证  发表于 2015-9-9 09:48:04
  1. //strippplot

  2. ssc install stripplot


  3. sysuse auto, clear
  4. gen pipe = "|"
  5. stripplot price, over(rep78) box(barw(0.3)) ms(none) mla(pipe) boffset(0.3)

  6. //From the Statalist:Nick cox 15/10/2010
复制代码

Graph.png



已有 1 人评分经验 论坛币 学术水平 热心指数 信用等级 收起 理由
xddlovejiao1314 + 50 + 20 + 1 + 1 + 1 精彩帖子

总评分: 经验 + 50  论坛币 + 20  学术水平 + 1  热心指数 + 1  信用等级 + 1   查看全部评分

163
niuniuyiwan 在职认证  发表于 2015-9-9 09:53:42

Graph.png


捕获.PNG

lexis.rar (796 Bytes) 本附件包括:

  • lexis.do





已有 1 人评分经验 论坛币 学术水平 热心指数 信用等级 收起 理由
xddlovejiao1314 + 50 + 20 + 1 + 1 + 1 精彩帖子

总评分: 经验 + 50  论坛币 + 20  学术水平 + 1  热心指数 + 1  信用等级 + 1   查看全部评分

164
niuniuyiwan 在职认证  发表于 2015-9-9 09:58:31
  1. //sixplot

  2. /*Displays six diagnostic and descriptive graphs for a single variable

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

  7. sysuse uslifeexp.dta

  8. sixplot le_male
复制代码

Graph.png


已有 1 人评分经验 论坛币 学术水平 热心指数 信用等级 收起 理由
xddlovejiao1314 + 50 + 20 + 1 + 1 + 1 精彩帖子

总评分: 经验 + 50  论坛币 + 20  学术水平 + 1  热心指数 + 1  信用等级 + 1   查看全部评分

165
niuniuyiwan 在职认证  发表于 2015-9-9 10:11:08

Graph.png



捕获.PNG

netplot-do.rar (505 Bytes) 本附件包括:

  • netplot-do.do


已有 1 人评分经验 论坛币 学术水平 热心指数 信用等级 收起 理由
xddlovejiao1314 + 50 + 20 + 1 + 1 + 1 精彩帖子

总评分: 经验 + 50  论坛币 + 20  学术水平 + 1  热心指数 + 1  信用等级 + 1   查看全部评分

166
niuniuyiwan 在职认证  发表于 2015-9-10 11:17:37
  1. //添加surf3数据集来源,findit surf3下载
  2. //修正surface为surface7

  3. use surf3,clear
  4. set more off
  5. surface7 x y z, orient(xzy) saving(s3d ,replace)
复制代码

d.png

z注:Z-axis刻度反向,待修改。



已有 1 人评分经验 论坛币 学术水平 热心指数 信用等级 收起 理由
xddlovejiao1314 + 50 + 20 + 1 + 1 + 1 精彩帖子

总评分: 经验 + 50  论坛币 + 20  学术水平 + 1  热心指数 + 1  信用等级 + 1   查看全部评分

167
niuniuyiwan 在职认证  发表于 2015-9-13 17:53:38
  1. /*binscatter_非参估计_其中添加mcol(green)
  2. binscatter generates binned scatterplots, and is optimized for
  3. speed in large datasets.
  4. Binned scatterplots provide a non-parametric way of visualizing the
  5. relationship between two variables. With a large number of observations,
  6. a scatterplot that plots every data point would become too crowded to
  7. interpret visually.  binscatter groups the x-axis variable into
  8. equal-sized bins, computes the mean of the x-axis and y-axis variables
  9. within each bin, then creates a scatterplot of these data points.*/
  10. ssc install binscatter
  11. clear all

  12. sysuse nlsw88, clear

  13. keep if inrange(age,35,44) & inrange(race,1,2)

  14. scatter wage tenure ,  mcol(green) title("Graph produced by Scatter") name(g1)
  15.         
  16. /* The scatter was too crowded to be easily interpetable. The binscatter
  17.    is cleaner, try a quadratic fit.*/

  18. binscatter wage tenure, line(qfit) xscale(range(0,25)) ///
  19. xlabel(0(5)25) ylabel(0(10)40) yscale(range(0,40))  ///
  20. title("Graph produced by Binscatter") name(g2)

  21. graph combine g1 g2
复制代码

Graph.png



已有 1 人评分经验 论坛币 学术水平 热心指数 信用等级 收起 理由
xddlovejiao1314 + 50 + 20 + 1 + 1 + 1 精彩帖子

总评分: 经验 + 50  论坛币 + 20  学术水平 + 1  热心指数 + 1  信用等级 + 1   查看全部评分

168
niuniuyiwan 在职认证  发表于 2015-9-18 14:13:21
  1. ssc install contour

  2. clear
  3. set obs 40
  4. gen a = 0.20 if [_n] == 1
  5. replace a = a[_n-1] - 0.02 if [_n] != 1
  6. gen b = a
  7. fillin a b
  8. gen pred = a*-1067.54 + b*-89.1
  9. gen _90 = pred >= 90

  10. twoway (contour _90 a b, levels(2) scolor(mint) ecolor(magenta) heatmap)

  11. twoway (contour _90 a b, scolor(mint) ecolor(magenta) levels(2) heatmap ///
  12.     zlabel(.25 "0" .75 "1"))
复制代码

Graph.png



已有 1 人评分经验 论坛币 学术水平 热心指数 信用等级 收起 理由
xddlovejiao1314 + 50 + 20 + 1 + 1 + 1 精彩帖子

总评分: 经验 + 50  论坛币 + 20  学术水平 + 1  热心指数 + 1  信用等级 + 1   查看全部评分

169
xddlovejiao1314 学生认证  发表于 2015-9-23 13:53:55
好贴,谢谢分享。
已有 1 人评分经验 论坛币 热心指数 收起 理由
niuniuyiwan + 100 + 20 + 5 精彩帖子

总评分: 经验 + 100  论坛币 + 20  热心指数 + 5   查看全部评分

170
niuniuyiwan 在职认证  发表于 2015-9-23 18:03:52
xddlovejiao1314 发表于 2015-9-23 13:53
好贴,谢谢分享。
感谢师兄哈

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

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