Code:
program drop myqreg
program myqreg
version 10.1
syntax [varlist] [if] [in] [, *]
if replay() {
_coef_table, `options'
exit
}
qreg `0'
endCode:
forvalues i = 1/100{
myqreg y x1 x2 x3 x4 x5 x6 x7 x8 if state==`i'
matrix define beta_`i' = e(b)
foreach n of numlist 1/5 {
local b`n'_`i' = beta_`i'[1,`n']
replace b`n' = `b`n'_`i'' if state == `i'
}
display "`i'"
}Code:
forvalues i = 1/100{
qreg y x1 x2 x3 x4 x5 x6 x7 x8 if state==`i'
matrix define beta_`i' = e(b)
foreach n of numlist 1/5 {
local b`n'_`i' = beta_`i'[1,`n']
replace b`n' = `b`n'_`i'' if state == `i'
}
display "`i'"
}Thanks.
Girish
0 Response to myqreg vs qreg
Post a Comment