R script and Stata Do file