楼主: 367310324
1106 0

[回归分析求助] 循环命令 [推广有奖]

  • 0关注
  • 0粉丝

小学生

50%

还不是VIP/贵宾

-

威望
0
论坛币
0 个
通用积分
0
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
50 点
帖子
3
精华
0
在线时间
5 小时
注册时间
2014-12-26
最后登录
2014-12-30

楼主
367310324 发表于 2014-12-27 16:47:33 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
gen Indcd=1 if  strmatch(  Industry,"A")
          replace Indcd=2 if  strmatch(  Industry,"B")
          replace Indcd=3 if  strmatch(  Industry,"C1")
          replace Indcd=4 if  strmatch(  Industry,"C2")
          replace Indcd=5 if  strmatch(  Industry,"C3")
          replace Indcd=6 if  strmatch(  Industry,"C4")
          replace Indcd=7 if  strmatch(  Industry,"D")
          replace Indcd=8 if  strmatch(  Industry,"E")
          replace Indcd=9 if  strmatch(  Industry,"F")
          replace Indcd=10 if  strmatch(  Industry,"G")
          replace Indcd=11 if  strmatch(  Industry,"H")
          replace Indcd=12 if  strmatch(  Industry,"I")
          replace Indcd=13 if  strmatch(  Industry,"K")
          replace Indcd=14 if  strmatch(  Industry,"L")
          replace Indcd=15 if  strmatch(  Industry,"M")
          replace Indcd=16 if  strmatch(  Industry,"N")
          replace Indcd=17 if  strmatch(  Industry,"P")
          replace Indcd=18 if  strmatch(  Industry,"Q")
          replace Indcd=19 if  strmatch(  Industry,"R")
          replace Indcd=20 if  strmatch(  Industry,"S")

          
         gen inv=.
forvalues i=2008/2012 {
    forvalues j=1/20 {
  reg  NewInvt TobinQ AReturn Cash Age LagInvest SIZE LEV if year==`i' & Indcd==`j'
    predict e
    replace inv=e if year==`i' & Indcd==`j'
            drop e
         }
         }
这个命令怎么不循环呢?只有2008年一年的数据,而且P、Q、R、S四个行业也没有值!

二维码

扫码加我 拉你入群

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

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

关键词:循环命令 forvalues Industry forvalue replace replace

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

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