Hello,
I need to run correlations between variables - for simplicity let's say only between two variables X and Y - by company (I have around 200 companies).
I would like to export just the correlation the two variables (without the 1s) in a separate row for each company, and include the number of obs used and the company name.
Also, if there are no observations, I would like to keep the row with the label so that I know which companies don't have enough obs.
I've tried this, among other things, but cannot make it vertical (row by row) and I cannot add firm names, and for the missing ones I just get an error and the program stops.
foreach i in 111 112 122 124 {
eststo: estpost corr X Y if firm==`i'
}
esttab using "Table2_Corr15.csv", wide not nonumber nonotes b(%3.2f) nolines obslast label compress
Thanks a lot!
Related Posts with Export correlations by group (row by row and with a label for each group)
Correlation categorical and continuous variableHi everyone and happy new Year, I would like to show in a plot that a categorical variable (a dummy…
Sargan Test is too sensitiveHello Dear Stata Forum Users, I have a panel dataset (14,545 observations) and been using Arellano-…
robust standard error for IV panel regressionHi I have been running panel data random effect 2sls (G2SLS) and i want to robust to heteroskedastic…
Combining time variables in panel data for forecastingHi, This is my first time here on statalist, I am trying to do a portfolio analysis in Stata and ra…
Bootstrap for outerweights in PLSSEMHi, I'm trying to get pvalues for the outer weights of the formative part of my measurement model in…
Subscribe to:
Post Comments (Atom)
0 Response to Export correlations by group (row by row and with a label for each group)
Post a Comment