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)
Code to get Beta coefficients in multiple imputation models in Linear regressionWhat's the code to get Beta coefficients in multiple imputation estimate models in Linear regression…
Creating new IDs with a set number of observationsHello all, I am trying to run a simulation on a dataset that contains user reviews. I have a select…
Histograms in loopHello Sir Have some issues with including titles in histograms in a loop. The code is running but n…
Working paper on entropy balancing and update to -ebalfit-A working paper describing the methods used in ebalfit is now available from https://ideas.repec.org…
Combining exact and propensity score matchingHi all, Would appreciate help with matching on propensity score within bins. I have either: Code…
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