Hello,
I'm estimating a model where I have 74,000 equations, and I want to export the estimators to an excel matrix.
My loop looks like this:
putexcel set elasticities.xls, replace
foreach z of {
foreach v of num 1/273 {
display `v'
gen ln_proportion`v' = ln(proportion`v')
foreach k of num 1/273 {
display `k'
reg ln_proportion`v' p_q`v' price`v' pr`k' income
putexcel `z'`k' = e(b)
}
}
}
The problem is the outside of the loop, cause I don't know how to assign the corresponding letters to the rows on excel (A,B,C....AA,AB,AC)
I was thinking of using the tokenize command to generate the whole ABCDEFGH.... code and break it into small parts but I haven't used it before and can't figure out how to do it.
Related Posts with Export matrix to excel. How to asign rows on a loop
Correlating random effects to study interhospital variationHi All, Using data from ~2000 hospitals, I have identified patients who underwent 1 of 3 operations…
what is the base for -collapse- percent statistic with by()?The -collapse- command (https://www.stata.com/manuals/dcollapse.pdf) has a -percent- statistic that …
spatial weight matrixHello, As part of my research, I want to build a spatial weight matrix. I want a variable that shows…
Calculating days elapsed between dates in Panel dataHello guys, I am trying to calculate days elapsed for each 'episode' between x and y values. For ex…
Post-estimation tests or heteroskedasticity check to confirm normality of the residuals?Hi Stata users, I'd like to ask for your help. I read STATA manual pdf on post-estimation for mixed…
Subscribe to:
Post Comments (Atom)
0 Response to Export matrix to excel. How to asign rows on a loop
Post a Comment