Hi Statalist!
I have a panel data set with multiple variables (X1, X2, ...). I am trying to run a multivariate regression for each country separately and store the coefficients in a single table. So far this is what I have:
tempname output
postfile `output' ID X1 X2 X3 X4 using output.dta,replace
levelsof ID, local(C)
foreach i of local C{
qui regress Y X1 X2 X3 X4 if id==`i'
post `output' (`i') (`=_b[X1]') (`=_b[X2]') (`=_b[X3]') (`=_b[X4]')
}
postclose `output'
My problem is that the "ID" variable has a long format and I am getting numbers in the output file, instead of actual country names. I do have a variable "country" that has a string format, but I just don't know how to transfer it to this new output file.
Any help would be much appreciated.
Related Posts with Storing values of a multivariate regression
Using svyset for melogitHello, I am analyzing a binary outcome (depvar) using melogit so that I may 1) account for the comp…
Suest command with more than 300 modelsHi all, I'm estimating arond 1000 models where the only thing that changes is the dependent variabl…
Restrict AxisI would like to restrict the x and y axis of a graph that was made using the following command; sca…
qreg converges in Stata/IC 15.0 (& gives reasonable standard errors), but fails to converge in Stata/MP 17.0Dear All, I have a household-level dataset of 511,877 observations, and run a quantile regression o…
Wildcards with noccurHi there, Can I use wildcards with the egen function noccur? If not, is there another way to use wi…
Subscribe to:
Post Comments (Atom)
0 Response to Storing values of a multivariate regression
Post a Comment