我正在尝试将相关矩阵转换为一个长列向量,以便我具有以下结构
data want;
input _name1_$ _name2_$ _corr_;
datalines;
var1 var2 0.54
;
run;
我有以下代码,它输出name1和 corr; 但是,我正在努力获得name2!
DATA TEMP_1
(DROP=I J);
ARRAY VAR[*] VAR1-VAR10;
DO I = 1 TO 10;
DO J = 1 TO 10;
VAR(J) = RANUNI(0);
END;
OUTPUT;
END;
RUN;
PROC CORR
DATA=TEMP_1
OUT=TEMP_CORR
(WHERE=(_NAME_ NE " ")
DROP=_TYPE_)
;
RUN;
PROC SORT DATA=TEMP_CORR; BY _NAME_; RUN;
PROC TRANSPOSE
DATA=TEMP_CORR
OUT=TEMP_CORR_T
;
BY _NAME_;
RUN;
帮助表示赞赏