Hello community!
I am running multiple regressions using a for loop and my end result is a table with as many columns as there are regressions (8 columns). I want to store my estimate, standard error, and the p-value from boottest for each regression. I saw a post by David Roodman (creater of boottest comand) on how to use estadd to include the p-value, and adding it via the scalar() option: https://www.statalist.org/forums/for...imation-tables
An example of my code is:
While I can see in the console that the p-value is being added as a scalar after each regression, some other p-values (and I don't know where from) are being added to the table when using esttab. I can see this in the console:
while the p-value being displayed in my .tex table is "0.534". My belief is that this is some stored p-value from some another regression, but it is definitely not the one I want. Would anyone know if I am using the correct command, or possibly overseeing something? Maybe the scalar() option is incorrect?
Any help is appreciated!
Best regards,
Sofia
I am running multiple regressions using a for loop and my end result is a table with as many columns as there are regressions (8 columns). I want to store my estimate, standard error, and the p-value from boottest for each regression. I saw a post by David Roodman (creater of boottest comand) on how to use estadd to include the p-value, and adding it via the scalar() option: https://www.statalist.org/forums/for...imation-tables
An example of my code is:
Code:
est clear foreach b in "sampleA" "sampleB" "sampleC" "sampleD"{ foreach s in "maleSample" "femaleSample" { if "`b'" == "sampleA" { eststo : qui reg female_w i.PostOct92 $u_p1 if `b'==1 & `s'==1, vce(cluster x) qui boottest 1.PostOct92, seed(1234) nograph estadd scalar p = r(p) } else { eststo: qui reg female_w i.PostOct92 $u_p2 if `b'==1 & `s'==1, vce(cluster x) qui boottest 1.PostOct92, seed(1234) nograph estadd scalar p = r(p) } } } esttab * using "new\uc_output_female_w.tex", append f /// cells(b(fmt(3)) se(fmt(3) star par([ ]))) noobs keep(1.PostOct92) varlabels(1.PostOct92 " ") /// star(* 0.10 ** 0.05 *** 0.01) alignment(D{.}{.}{-1}) /// stats(p) /// label booktabs nomtitle noline nonumber collabels(none) eqlabel(none)
While I can see in the console that the p-value is being added as a scalar after each regression, some other p-values (and I don't know where from) are being added to the table when using esttab. I can see this in the console:
Code:
(est1 stored) added scalar: e(p) = 0
Any help is appreciated!
Best regards,
Sofia
Comment