Dear Statalisters,
I would like to find out whether it is possible to select the specific column(s) to be produced in the correlation matrix output.
Supposedly:
The code above produces the same number of columns for every var in [varlist].
To illustrate:
The output I'm looking for is, vertically, it will initially consist of all variables listed (var1 to var20), but for horizontally, I would like to handpick which column order to be produced (i.e. var1 to var5). I will then remove some vars from the [varlist] according to what I have produced horizontally on the previous table so then I can make separate esttab outputs after a specific order/sequence. The illustration on the order of the codes will be something like this:
Obviously, the codes above will not produce the output I want (except for the Fourth Sequence, it will do just fine; see the table outline illustrated below), as it is just to illustrate the order of correlation tables I intend to produce using esttab command. Notice that I only include the variables that have not been on the First Sequence's columns to be on the Second Sequence, etc. In order to provide a clearer picture, the table layout I am looking for will look like this:
First Sequence:
Second Sequence:
Third Sequence:
Fourth Sequence:
My apologies for using the code delimiter to illustrate the table output. Obviously, it is not a sequence of codes, but I hope you understand I am trying to describe the correlation output table that I would like to very much produced. Any help will be much appreciated. Thank you so much and cheers!
Best,
Nampuna
I would like to find out whether it is possible to select the specific column(s) to be produced in the correlation matrix output.
Supposedly:
Code:
estpost correlate var1-var20, matrix esttab . using CorrTable.tex, replace
To illustrate:
Code:
Variable | var1 | var2 | var3 | var4 | var5 | var6 | var7 | var8 | var9 | var10 | ... | var20 var1 var2 var3 var4 var5 var6 var7 var8 var9 var10 . . . var20
Code:
estpost correlate var1-var20, matrix // First Sequence with var1-var5 on the columns esttab . using CorrTable1.tex, replace estpost correlate var6-var20, matrix // Second Sequence with var6-var10 on the columns esttab . using CorrTable2.tex, replace estpost correlate var11-var20, matrix // Third Sequence with var11-var15 on the columns esttab . using CorrTable3.tex, replace estpost correlate var16-var20, matrix // Fourth Sequence with var16-var20 on the columns esttab . using CorrTable4.tex, replace
First Sequence:
Code:
Variables | var1 | var2 | var3 | var4 | var5 var1 var2 var3 var4 var5 var6 var7 var8 var9 var10 var11 var12 var13 var14 var15 var16 var17 var18 var19 var20
Code:
Variables | var6 | var7 | var8 | var9 | var10 var6 var7 var8 var9 var10 var11 var12 var13 var14 var15 var16 var17 var18 var19 var20
Code:
Variables | var11 | var12 | var13 | var14 | var15 var11 var12 var13 var14 var15 var16 var17 var18 var19 var20
Code:
Variables | var16 | var17 | var18 | var19 | var20 var16 var17 var18 var19 var20
Best,
Nampuna
Comment