楼主: honestwh
2013 1

[编程问题求助] 求教stata编程问题,非常感谢 [推广有奖]

  • 8关注
  • 8粉丝

教授

78%

还不是VIP/贵宾

-

威望
0
论坛币
82531 个
通用积分
59.0812
学术水平
0 点
热心指数
7 点
信用等级
0 点
经验
12584 点
帖子
268
精华
0
在线时间
2720 小时
注册时间
2005-9-25
最后登录
2024-5-18

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
<p>希望打下帮我编个小程序,现在有HS-6位码的各种商品各个国家的单位出口价格(p)和出口量(q),在求出各种商品的世界平均价格(uv)后,把商品分成低、中、高三类,划分原则如下:</p><p>For each HS-6 product, we compute the world unit value average (noted UV). We then classify each flow:</p><p>– Flows with unit values verifying UV−25%, UV+25% belong to the medium range, along</p><p>with the last decile of [min,  UV−25%] and the first decile of [  UV + 25%, max].</p><p>– The first nine deciles of [min, UV−25%] are considered low range.</p><p>– The last nine deciles of [UV +25%, max] are considered high range.</p><p>谢谢大家的帮助。</p>
二维码

扫码加我 拉你入群

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

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

关键词:求教stata stata编程 Stata 非常感谢 tata average product medium values world

回帖推荐

liuxb 发表于2楼  查看完整内容

Supposing your dataset is as follows:name  priceA     10A     15…    …B     20B     30…    … Hope the Stata codes below will help you to solve your problem.  sort nameegen int gname = group(name)qui tabu gnamelocal ngname = `r(r)'forvalue i = 1(1)`ngname' {  qu ...

本帖被以下文库推荐

沙发
liuxb 发表于 2008-8-12 16:45:00 |只看作者 |坛友微信交流群

Supposing your dataset is as follows:

name  price

A     10

A     15

   

B     20

B     30

   

 

Hope the Stata codes below will help you to solve your problem.

 

 

sort name

egen int gname = group(name)

qui tabu gname

local ngname = `r(r)'

forvalue i = 1(1)`ngname' {

  qui sum price if gname == `i', d

  gen int group`i' = irecode(price,`r(p25)',`r(p75)') if gname == `i'

}

sort name price group1-group`ngname'

 

已有 1 人评分论坛币 学术水平 热心指数 收起 理由
crystal8832 + 10 + 1 + 1 热心帮助其他会员

总评分: 论坛币 + 10  学术水平 + 1  热心指数 + 1   查看全部评分

使用道具

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

本版微信群
加好友,备注jltj
拉您入交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-5-21 13:21