全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Stata专版
598 0
2020-03-27
The number of states assigned to treatment is randomly determined, but at least 25% of statesmust be classified as treated and at least 25% of states must be classified as control in anypseudo-experiment.  

我只会一半一半
local STATES = 51
local PERIODS = 120

gen t = runiform() if period  == 1

egen rank = rank(t)
gen T = .
        replace T = 0 if rank >= 1 & rank<= `STATES'/2
        replace T =1 if rank >`STATES'/2 & rank<= `STATES'


如何才能 随机25% 呢?
二维码

扫码加我 拉你入群

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

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

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

说点什么

分享

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