Hello,

there is a problem occuring with exported regression results. 1) I have a full regression output 2) I put estimates of one variable of interest in a separate table, say, a reduced form of 1). The underlying regressions are the SAME. Yesterday, the reduced table was perfectly fine. Now, I get mixed results.

The problem is best described in this picture:

Array

While the numbers are "correct", some parentheses are missing, the values are multiplied by 100 and se is negative. Not for all results though!

The blue code is what produced the table on the left side of the picture.
I think the way I loop or store the estimates could cause this problem? Or maybe it's a bug?

I appreciate any help. Thank you!! Rebecca

Code:
*[REGRESSIONS] Run from -preserve- to -restore-:

preserve
collapse (firstnm) labor* saved* hcap* yft war urban, by(id)

*[TABLE 1] Complete regression output:
*Loop 1 START
foreach j in "L" "G" "P"{

 *Loop 2 START
 foreach var of varlist labor saved hcap{
  quietly regress `var'_`j' yft `var'_0 war urban
  outreg2 using "$path/Approach1.xls", ///
  sortvar(yft c.yft#c.yft labor_0 saved_0 hcap_0 war urban) excel append
  quietly regress `var'_`j' c.yft##c.yft `var'_0 war urban
  outreg2 using "$path/Approach1.xls", ///
  sortvar(yft c.yft#c.yft labor_0 saved_0 hcap_0 war urban) excel append
 }
 *Loop 2 END
}
*Loop 1 END: Table 1 complete


*[TABLE 2] Only estimated coefficients of yft from 18 regressions:
*[NOTE] Storing the estimates in Loop 3 could be included in Loop 2 as well but
*for the sake of traceability it is done separately. Regressions are the same.

*Loop 3 START
foreach j in "L" "G" "P"{

 *Loop 4 START
 foreach var of varlist labor saved hcap{
  quietly regress `var'_`j' yft `var'_0 war urban
  estimates store L`var'_`j'
  *[NOTE] L stands for linear specification of yft.
  quietly regress `var'_`j' c.yft##c.yft `var'_0 war urban
  estimates store Q`var'_`j'
  *[NOTE] Q stands for quadratic specification of yft.
 }
 *Loop 4 END
}
*Loop 3 END: Estimates stored
 
restore


*[NOTE] Proceeding to build Table 2: First block puts all estimates of the linear specification
*of yft in one row. Second block puts all of the quadratic specification in one row.
*[CREDIT]: -estout- written by Ben Jann.
estout Llabor_L Lsaved_L Lhcap_L ///
Llabor_G Lsaved_G Lhcap_G ///
Llabor_P Lsaved_P Lhcap_P using "$path/Estimates_yft.xls", ///
replace keep(yft) cells(b(star fmt(5)) se(par fmt(5))) collabels(none) style(tab) ///
starlevels(* 0.1 ** 0.05 *** 0.01) ///
mlabels(,depvars) lz title(Estimated Coefficients of yft in Two Specifications) ///
posthead("__Linear specification: ________________@hline") ///
prefoot("__Quadratic specification: _____________@hline") hlinechar(__)

estout Qlabor_L Qsaved_L Qhcap_L ///
Qlabor_G Qsaved_G Qhcap_G ///
Qlabor_P Qsaved_P Qhcap_P using "$path/Estimates_yft.xls", ///
append keep(yft c.yft#c.yft) cells(b(star fmt(5)) se(par fmt(5))) collabels(none) ///
mlabels(none) style(tab) nonumbers legend lz hlinechar(__) ///
starlevels(* 0.1 ** 0.05 *** 0.01) ///
note("Standard errors in parentheses _________@hline")
Data example for the green marked regression's variables.

Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input float(labor_0 labor_L id) int yft float(urban war)
        .         .   1    .  50.327 0
26.702543  26.96436   2 2000 21.1325 1
 40.47243  40.98727   3 1995 36.4375 1
 43.22406   42.0781   4 1965  36.293 0
        .         .   5    .  94.792 0
 50.51339 71.237785   6    . 79.1235 0
 41.19841  44.26669   7 1910 86.7985 0
 41.39095  47.97966   8 1965 67.5555 0
        .         .   9    . 80.6055 0
        .         .  10 1960 35.3855 0
 49.79837  53.07124  11    .  85.448 0
 46.47499  51.13418  12 1915 63.0955 0
 40.58215  49.39155  13 1965  53.903 1
  47.6275   44.3517  14 1995   6.159 1
 39.61708  44.85672  15 1905 96.3345 0
 39.26097  39.89404  16 1985 34.1075 0
 43.82782 37.847466  17 2000  13.689 0
 32.57019  38.68617  18 1980 19.5705 0
 46.17568   46.3249  19 1925  66.206 0
 43.69338  57.55104  20 1970 88.0445 0
 48.63773  58.73232  21 1965  79.561 0
 39.48907  40.62098  22    .  39.082 1
 46.07006  53.65329  23    .  65.783 0
 32.97859  43.20228  24 1965   47.56 0
        .         .  25 1965     100 0
 40.15187  47.00981  26 1975  55.074 0
 40.13055  49.44241  27 1965 73.5305 0
 52.39079  54.45883  28 1955  37.512 0
 42.50053  50.01518  29 1960  66.364 0
 36.19472  48.47885  30 1995 16.0165 0
34.697643  40.38333  31 1975 40.2905 0
 41.04831   41.1025  32 1990 36.7845 0
 52.95413  55.61936  33 1915  76.572 0
 56.70659  56.86971  34 1910  73.956 0
 48.31913  49.67947  35    . 31.4445 0
 37.74898  47.10867  36 1960  83.207 0
 56.37349  58.30558  37 1968 26.0715 0
37.199116 34.101265  38 1985 39.1605 0
 41.72177  42.93423  39 1985 39.3695 0
 39.35339  38.99584  40 2000 30.4175 1
 38.59076  40.53418  41 2000 54.1145 1
 34.03326  50.78221  42 1965 69.2445 1
 23.10068 24.837463  43 1990 27.6235 0
33.248215  39.09181  44    .  42.812 0
 37.91256  45.65006  45 1962  49.546 0
 38.39698  45.82556  46 1920  73.126 0
        .         .  47    . 84.5415 0
        .         .  48 1965     100 0
 44.59546  52.62164  49    . 66.5685 0
 47.79623  50.03905  50    . 75.2345 0
 48.94692  51.37965  51 1900  73.047 0
34.862415  38.65941  52 1985  75.855 0
        .         .  53    . 62.2645 0
 55.85773  52.81248  54 1910   84.81 0
 39.11825  43.78292  55 1965 55.0905 0
 25.02489  30.83511  56 1975 51.6915 1
 39.21555  45.06962  57 1970  54.704 0
 27.49572 33.484417  58 1965 43.5445 0
 45.47882  47.06181  59 1990  18.572 1
 40.12445  50.62084  60 1902 75.2385 0
 49.32022  51.36987  61    .  71.323 0
 41.86633  46.51805  62 1990 12.5005 1
 52.60161   49.9537  63 1915  79.029 0
36.968246  40.28757  64    .  41.228 0
 44.65259  45.92065  65 1900  74.003 0
        .         .  66    .  30.513 0
        .         .  67    .  25.851 0
27.618114  31.01414  68 2000 68.4675 0
 50.72644  50.99931  69 1910  78.165 0
 49.80108  53.16368  70 1965 55.1575 1
 42.44049  46.01094  71 1985   36.08 0
        .         .  72    .     100 0
36.844402  36.58928  73 1995 27.8835 0
30.845936  31.84341  74 1985  37.769 0
 39.58134  41.03652  75 2000  30.071 0
 35.00396  36.23053  76    .   34.25 0
 41.17298  46.29043  77    .  71.373 0
        .         .  78    .  33.402 0
        .         .  79    . 79.5285 0
33.678013 38.024178  80 1985 41.8265 0
 50.18623  48.44146  81    .  90.899 0
 37.98178 37.892403  82 1965  29.628 0
 50.29952  52.05784  83    . 99.3055 0
35.511353  40.77198  84 1985 40.2145 0
 46.39473  44.54397  85    .  50.862 0
 38.32986  42.24024  86 1985 27.9575 0
 43.40657  42.99639  87 1890  65.824 0
 40.22723  48.23806  88 1970 30.1175 0
        .         .  89    .  51.748 0
 37.65082  38.23056  90 1978  25.426 1
 38.35191  48.49313  91    . 56.8665 0
 25.31732 33.034397  92 1985  56.062 0
22.932674  27.31541  93 1975 69.7975 1
 55.71056  59.32411  94    .  90.637 0
 40.55227  45.84111  95 1955  90.307 0
 42.17038  41.24905  96 1925  66.736 0
 44.70655  48.49929  97 1925  49.342 0
21.970116  26.37093  98 1975  72.693 0
 51.70332  52.05392  99 1950  77.276 0
 48.74479  53.42389 100    . 56.3115 0
end