i merged my correlations and summary statistics to one table via the below code (thanks again to the forum) and now would like to display significance stars (ideally for p value of 0.1, 0.05 and 0.01). I think i should add ", star(.1 .05 .01)" somewhere, but when i e.g. added it right after the pwcorr command it threw me an error . Where would i need to change my code?
Code:
** Set variables used in Summary and Correlation
local variables dropsize femaleCEO CEOtenure CEOduality CEOage FirmSize PotentialSlackResources PercentageFemaleDirectors ROA_2007Q3 if min_quarter<LeftasCEO
local labels `" "Dropsize (in %-points)" "Female CEO" "CEO Tenure (log)" "CEO Duality" "CEO Age" "Firm Size (log)" "Potential Slack Resources(log)" "Percentage of Female Directors (in %)" "ROA 2007Q3 (in %)" "'
** Descriptive statistics
estpost summarize `variables'
matrix table = ( e(min) \ e(max) \ e(mean) \ e(sd) )
matrix rownames table = min max mean sd
matrix list table
** Correlation matrix
pwcorr `variables'
matrix C = r(C)
local corr : rownames C
matrix table = ( table \ C )
matrix list table
estadd matrix table = table
local cells table[min](fmt(2) label(Min)) table[max](fmt(2) label(Max)) table[mean](fmt(2) label(Mean)) table[sd](fmt(2) label(Standard Deviation))
local collab
local drop
local i 0
foreach row of local corr {
local drop `drop' `row'
local cells `cells' table[`row']( fmt(4) drop(`drop') label((`++i')) )
local lbl : word `i' of `labels'
local collab `" `collab' `row' "(`i') `lbl'" "'
}
display "`cells'"
display `"`collab'"'
esttab using SumStatCorTabH1.rtf, ///
replace ///
compress ///
star(* 0.1 ** 0.05 *** 0.01) ///
cells("`cells'") ///
coeflabels(`collab')
No comments:
Post a Comment