全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Stata专版
1308 1
2020-05-30
replication data里文件里要求装backup和backto的包来备份变量的不同版本,但是网站打不开装不上,请问有替代方法吗?
*Install "backup" and "backto" ado files, which create backed up versions of variables
net from http://home.gwu.edu/~bartels/stata
*install 'backto' and 'backup' by clicking on them


二维码

扫码加我 拉你入群

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

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

全部回复
2020-5-30 12:33:04
*Install "backup" and "backto" ado files, which create backed up versions of variables
net from http://home.gwu.edu/~bartels/stata
*install 'backto' and 'backup' by clicking on them
logit meritocracy grind812cnty grind812_2 medearn812cnty_01 medearn812cnty01_2 gini0812cnty_01 pctfembus07cnty_01 bsf812cnty_01 punemp812cnty_01 pubsector0812cnty_01 pmccain_01 popden0812cnty_01 totpop812cnty_01 womgov08 pwomstleg08_01 education_01 income_i_01 Age black hispanic asian married unemployed partyid_01 ideology_01 religattend_01 sid20094 s2011 s2012 if male==0
gen obs=1 if e(sample)
sort obs
backup grind812cnty grind812_2
qui gen prob_grind=.

set more off

forvalues i=1(1)6183 {
        qui replace grind812cnty=grind812cnty[`i']
        qui replace grind812_2=grind812_2[`i']
        qui predict prob if obs==1
        qui su prob
        qui replace prob_grind=r(mean) in `i'
        qui drop prob
        qui backto grind812cnty grind812_2
        di `i'
}

backto grind812cnty grind812_2

label var prob_grind "Predicted Probability"
line prob_grind grind812cnty, sort
sort prob_grind
list  prob_grind grind812cnty if _n==6183
line prob_grind grind812cnty if obs==1, sort

完整的代码是这样的
二维码

扫码加我 拉你入群

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

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

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

说点什么

分享

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