问题
I need to get a Spearman and Pearson correlation table using Stata. Here is what I did to get the results in a table format.
estpost correlate sp_rating srating mrating split split_neg split_ord split_neg_ord tier1_risk tier1_leverage st1 sl mt1 ml adt1 adl dt1 dl offering_amt maturity2 security
enhance timeliness validity disc loan_at cash_dep trading_at real_est intangible other_at sec_sum assets_sold all_residual secinc_ta, matrix quietly
esttab . using "root4.rtf", replace notype unstack compress noobs nogaps nostar
Then, I get this error message:
varlist not allowed
When I used just a few variables, I didn't get the error, but when I put many variables. I don't know how to fix this. Please help me.
回答1:
I was able to reproduce your error and ran a trace
on it. I believe this is a bug at line 946 of estout.ado
, perhaps caused by the fact that a very long variable list with RTF tags exceeds the size of the local macro created at that line.
You should send a bug report to Ben Jann (email at the end of help estout
). In the meantime, you can try saving to DOC and TXT, both of them might work (you have over 30 variables, I tested both .txt
and .doc
successfully with something like 20 variables).
Alternately, try the mkcorr
command (ssc install mkcorr
) to see if it works with your data.
回答2:
I just had the same problem after I tried a lot of different esttab
outputs and had stored a lot in estimates.
So, maybe estimates clear
helps if you type it before running your command. At least for me it worked.
来源:https://stackoverflow.com/questions/14129291/how-to-make-tables-out-for-spearman-correlation-table