Code:
gen beta=. quietly{ forvalues i=1(1)1000 { preserve //generating a random number and drawing first 20000 as samples from the data// set seed 135790 gen random=runiform() sort random gen insample=_n<=20000 //Panel regression// xtset id time xtreg y lag_y x1 x2 x3 x4 x5 //The variables are obtained from the already available data set// local coeff=_b[lag_y] restore //Store the beta values// replace beta=`coeff' in `i' } } summ beta
0 Response to Drawing random sample multiple times from a large data set
Post a Comment