I need to run the same exercise (Monte Carlo simulations) from Stata to R.
The codes I have used in Stata are the codes bellow. How can I do this using R? (I have searche