Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: oblong correlations with makematrix


From   Kit Baum <[email protected]>
To   [email protected]
Subject   st: oblong correlations with makematrix
Date   Wed, 17 Nov 2004 19:38:48 -0500

As noted, cpcorr can generate oblong correlations, but applies listwise deletion on this hacked version of auto.dta:

. cpcorr price headroom \ displacement turn
(obs=64)

displacement turn
price 0.5174 0.2990
headroom 0.4758 0.4369

"cpcorr2" includes my suggested pairwise option and does pairwise correlations:

. cpcorr2 price headroom \ displacement turn, pair
(obs=74)

displacement turn
price 0.4916 0.3015
headroom 0.4792 0.4303

As Nick Cox notes, it is not necessary to build this feature into cpcorr, as it is feasible to generate those pairwise correlations using his 'makematrix' routine:

. makematrix, from(r(rho)) cols(displacement turn) listwise: corr price headroom

displacement turn
price .49158291 .30145184
headroom .47921817 .43027963


Kit Baum, Boston College Economics
http://ideas.repec.org/e/pba1.html

*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/




© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index