Also, the estimation I need this for is mlogit just in case there is an option for reg estimation to force include certain variables. To my knowledge there is no such option for mlogit. So, my best hope is to take advantage of how Stata decides to drop coll variables.
set more off
capture program drop myprog
program myprog
reg Y HD* AD*
foreach l of numlist 1/11 {
gen HD`l'Cf = _b[HD`l']
}
foreach l of numlist 1/11 {
gen AD`l'Cf = _b[AD`l']
}
end
rangerun myprog, interval(Order -50 0) verbose
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input float Order byte(Y HD1 HD2 HD3 HD4 HD5 HD6 HD7 HD8 HD9 HD10 HD11 AD1 AD2 AD3 AD4 AD5 AD6 AD7 AD8 AD9 AD10 AD11) 1 2 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 2 1 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 3 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 4 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 5 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 6 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 7 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 8 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 9 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 10 3 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 11 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 12 1 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 13 1 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 14 3 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 15 6 0 0 0 0 0 0 0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 0 0 1 0 0 0 0 end
0 Response to While using rangerun, change the order of items in a local macro containing variable list (dummies) at each iteration
Post a Comment