Date: Tue, 10 Apr 2001 10:00:41 +0200
Reply-To: Gijs Dekkers <gd@PLAN.BE>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Gijs Dekkers <gd@PLAN.BE>
Organization: planbureau / bureau de plan
Subject: 2nd question on PROC CORR
Content-Type: text/plain; charset=us-ascii
Dear fellow SAS-users,
Another question on PROC CORR, I'm afraid.
I have two variables SCV1 and SCV2, and I use proc corr to derive the
correlation coefficient. But I want to destillate this one figure from
the outputfile generated by this procedure.
I have used the following datasteps, but this is not good, because it
does not always work. Sometimes, the variables COL1 (see below) is
So, the question is: how can I destillate just the one correlation
coefficient from the output-file of the PROC CORR-statement?
Any help would be greatly appreciated.
Proc Corr data=alles out=f3 ;
var SCV1 SCV2 ;
data f3 ;
set f3 ;
drop SCV2 ;
if (_NAME_='SCV2') then output ; /* _name_ <> varname.
Otherwise corr=1 */
PROC TRANSPOSE OUT=TEMP;
BY _NAME_ ;
PROC SORT OUT=TEMP;
PROC TRANSPOSE DATA=TEMP OUT=FINAL;
VAR COL1; /* this one is not always there */
data corrl ;
set final ;
drop COL1 ;
dr. Gijs Dekkers
B 1000 Brussel