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)
Using numbers from tabulate var1 var2 into mcciDear Statalists, I need to perform a lot of McNemars using mcc or mcci (with a preference for mcci)…
Running two loopsHey, I have the following problem. Let's suppose I have this data set country A B C Germany 5 6 7…
Replacing String variables with another string variable. (String variables contain data from multi select questions)Hi. im trying to replace observations of a string variable from another string variable (Both the st…
Synthetic control for MicrodataI am using IPUMS microdata to run a differences-in-differences model and I want to augment it with a…
Instrumental variable with ordinal dependent variable(reject the parallel test)Dear all, I am using the instrumental variable approach. My X variable is a binary variable, and Y …
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