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

st: oblong correlations with makematrix

From   Kit Baum <>
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

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

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

* For searches and help try:

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