Hi everyone,
I have one very simple question which concerns the results from a regression analysis that I output to Excel.
I run regressions and perform F tests post hoc to test for the differences between certain variables to be significant. The code I use is included below. Now, all works well and the output in Excel looks great, except the F-test values. That is to say, the output shows all values correctly, but leaves the cells for the p values of the f tests blank.
To complicate the matter, when a colleague of mine runs the same code, the p values do show. I am using Stata 14.2 and am not sure of the version my colleague is using. Another colleague of mine with the same version of Stata as I have, experienced the same problems: the p values do not show.
Is this a well-known problem? Does this have sth to do with my version of Stata? If so, what can I do, other than updating to Stata 15? Or is there sth different going on with my code?
Here the part of the code that should be relevant:
I have asked around a lot but to no avail. So, thanks loads in advance for any help you can provide!
Best,
Julius
I have one very simple question which concerns the results from a regression analysis that I output to Excel.
I run regressions and perform F tests post hoc to test for the differences between certain variables to be significant. The code I use is included below. Now, all works well and the output in Excel looks great, except the F-test values. That is to say, the output shows all values correctly, but leaves the cells for the p values of the f tests blank.
To complicate the matter, when a colleague of mine runs the same code, the p values do show. I am using Stata 14.2 and am not sure of the version my colleague is using. Another colleague of mine with the same version of Stata as I have, experienced the same problems: the p values do not show.
Is this a well-known problem? Does this have sth to do with my version of Stata? If so, what can I do, other than updating to Stata 15? Or is there sth different going on with my code?
Here the part of the code that should be relevant:
Code:
// here are some locals with variables which serve as outcomes, controls, etc. for the regression local i = 1 local m = 1 // estimation loop going through all possible outcomes (which come in dimensions) and running regressions foreach this_dim in `dims' { est drop _all foreach var in ``this_dim'' { /* * ITT - Saturated Without Controls xi: reg W3_`var' `x_treatment' i.W1_village, rob noconstant est sto T`m'_`this_dim'_`i' estadd ysumm test book_only-book_mov=0 estadd scalar f1 = r(p) test book_only-book_ast=0 estadd scalar f2 = r(p) test book_only-book_mov_ast=0 estadd scalar f3 = r(p) sum W3_`var' if control==1 estadd scalar mean = r(mean) estadd scalar sd = r(sd) local ++i } capture erase "PAPER Business performance\Stata output\T`m'_`this_dim'_ITT.csv" * csv output #delimit ; esttab T`m'_`this_dim'_* using "PAPER Business performance\Stata output\T`m'_`this_dim'_ITT.csv", label replace modelwidth(16) varwidth(50) depvar legend cells(b(star fmt(%9.3f)) se(par)) star(* 0.10 ** 0.05 *** 0.01) stats(r2 N mean sd f0 f1 f2 f3, fmt(%9.3f %9.0g %9.3f %9.3f %9.3f %9.3f %9.3f %9.3f) labels("R-squared" "N" "Dependent Variable Mean in Control Group" "Dependent Variable SD in Control Group")) title("`e(title)' of `this_dim'" variables on treatment) keep(book_*); #delimit cr local ++m }
I have asked around a lot but to no avail. So, thanks loads in advance for any help you can provide!
Best,
Julius
Comment