全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Stata专版
1076 0
2014-12-27
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四个行业也没有值!

二维码

扫码加我 拉你入群

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

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

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

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