Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: RE: Selecting correlations with highest absolute value

From   Joe Canner <>
To   "" <>
Subject   st: RE: Selecting correlations with highest absolute value
Date   Tue, 8 Oct 2013 19:39:07 +0000


Here's one quick-n-dirty possibility. (It requires installing -matvsort- from SSC.)

. corr varlist
. matrix corrvector=vec(r(C))
. matvsort corrvector sortedvector
. matrix list sortedvector

Joe Canner
Johns Hopkins University School of Medicine

-----Original Message-----
From: [] On Behalf Of Dara Shifrer
Sent: Tuesday, October 08, 2013 3:16 PM
Subject: st: Selecting correlations with highest absolute value

In SAS, I was able to quickly determine which pairs of variables were 
most highly correlated using the 'best' option with the 'proc corr' 
command ("*BEST=*/n ----/**/**/prints */n/* correlation coefficients for 
each variable. Correlations are ordered from highest to lowest in 
absolute value.) After extensive searching, I have not been able to 
locate a Stata command that does something similar.

If this is not possible in Stata, maybe Stata experts have suggestions 
for my ultimate purpose: constructing equations to facilitate a smoother 
and faster running of Stata's 'ice' command.

Any help would be greatly appreciated,
Dara Shifrer

Postdoctoral Fellow, Houston Education Research Consortium
Kinder Institute for Urban Research
Rice University

*   For searches and help try:

*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index