'store model coeficients and standard errors using postfile stata 15

I want to transfer model estimates from Stata to R. I found on Stack Overflow the suggestion to do this using postfile. Since my Stata knowledge is limited I followed a guide from Arizona University (https://jearl.faculty.arizona.edu/sites/jearl.faculty.arizona.edu/files/CR2%20Post.pdf).

At the end you can see the code I deducted from this guide. However, I was unsuccessful and received l.log_imputed_welfarespending_pc_b invalid name as an error. Can anyone spot my mistake or propose an alternative way to export the models estimates to R?

xtlogit priowaronset2 c.l.log_imputed_welfarespending_pc##c.l.transnational_rebels l.gdplog l.poplog l.polity2 oil nbs_civilwar nbs_trade nbs_dem noncontiguity relfrac gdppcgrowth mountaniousterrain l.decaywarprio10 asia ssafrica lamerica eeurop western nafrme if year>1974,re vce(robust)

tempname memhold
postfile `memhold'
l.log_imputed_welfarespending_pc_b l.transnational_rebels_b l.log_imputed_welfarespending_pc##c.l.transnational_rebels_b l.log_imputed_welfarespending_pc_se l.transnational_rebels_se l.log_imputed_welfarespending_pc##c.l.transnational_rebels_se using "modelcoef.dta", replace
    
xtlogit priowaronset2 c.l.log_imputed_welfarespending_pc##c.l.transnational_rebels l.gdplog l.poplog l.polity2 oil nbs_civilwar nbs_trade nbs_dem noncontiguity relfrac gdppcgrowth mountaniousterrain l.decaywarprio10 asia ssafrica lamerica eeurop western nafrme if year>1974,re vce(robust)

post `memhold' (_b[l.log_imputed_welfarespending_pc]) (_se[l.log_imputed_welfarespending_pc]) (_b[l.transnational_rebels]) (_se[l.transnational_rebels]) (_b[l.log_imputed_welfarespending_pc##c.l.transnational_rebels]) (_se[l.log_imputed_welfarespending_pc##c.l.transnational_rebels])

postclose `memhold'




  


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source