全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Stata专版
2380 0
2009-02-26

  prog birth,rclass
  drop _all
  tempvar y
    forvalues j=20/40{
    set obs `j'
    gen `y'=10*int(365*uniform())
      scalar  z`j'=0
      sort `y'
            forvalues i=1/`1'{
                 if `y'[`i']==`y'[`i'+1]{
                 return  scalar z`j'=1
                 continue, break
                }
             }
   }
 }
end
simulate z, reps(100): birth
就是这个程序,本来是单个数据模拟的,怎样才能变成循环数据模拟的呢??直接在子程序里调用么??

二维码

扫码加我 拉你入群

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

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

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

说点什么

分享

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