Quantcast
Channel: Statalist
Viewing all articles
Browse latest Browse all 72786

simulating several regressions

$
0
0
Hi Gang,
I'm trying to run a simulation, where I simulate and estimate two different regressions. How can I get both sets of coefficients reported, rather than just those from the last regression? A toy version of what I want is:

capture program drop myfilename
program define myfilename
drop _all
set obs 100

gen e1 = rnormal()
gen e2 = rnormal()

gen x1 = rnormal()
gen x2 = rnormal()

gen y1 = 1 + 2*x1 + e1
gen y2 = 3 + 4*x2 + e2

reg y1 x1
reg y2 x2

end

simulate _b, reps(500): myfilename
sum

Viewing all articles
Browse latest Browse all 72786

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>