全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Stata专版
12290 10
2012-09-01
我想做一个散点图,横轴是年龄,纵轴是分类变量性别。这样同一年龄同一性别的人可能有多个,代表他们的点就重合了,同一年龄同一性别的人不管用一个还是多个,点的大小都是一样的,无法区分,请问有没有相关的命令解决这一问题,在散点图上用点的大小代表其频数,有点像excel里用气泡图做的三个变量的那种散点图。多谢大神啦,急用,在线等^_^
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2012-9-1 11:39:50
没有人知道吗?急啊!!
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-9-1 14:22:52
你先上传一个样本数据,别人才好画
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-9-2 11:38:01
你是想画出每个年龄组中男女所占的频率/比例吗?为什么不画histogram?
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-12-4 20:51:00
同意楼上的建议,画直方图就挺好的了
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-12-5 01:23:46
actually, there is a solution.

see http://www.stata.com/statalist/archive/2012-04/msg01149.html


or




At a guess you want
egen freq = total(1), by(dr1995 mat blind)

egen tag = tag(dr1995 mat blind)

scatter dr1995 mat if blind == 1 & tag [fw=freq] || ////

scatter dr1995 mat if blind == 2 & tag [fw=freq] ||


On Wed, Apr 25, 2012 at 1:04 PM, Malin Lundberg Rasmussen<Malin.Lundberg.Rasmussen@ouh.regionsyddanmark.dk> wrote:> I have a problem;> I am making a scatter plot of two variables, divided by two groups.> I am using the following command:>> twoway (scatter dr1995 mat if blind==1 ,  m(Oh)) ///> (scatter dr1995 mat if blind==2,  m(Oh))>> My problem is that I get the same size of circle for each point (and where both groups is represented I only get one color). I would like the dot to represent the number of patients (in both groups), so that if ten people represent circle number 1, this would be bigger than another circle representing only two patients.> I tried the [fw=?], but don't know what to put instead of "?".>



二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

点击查看更多内容…
相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群