Hi all,
I am trying to calculate the correlation between 4 variables (listening scores, writing scores, speaking scores, reading scores) with macro. It only calculates the correlation between the same variable (for example, the correlation between listening score and listening score ) with below macro. Could you help to find out why?
Thank you,
%macro com(c);
%do i=1 %to 12;
proc corr data=on_cl_&c._onl_gr_&i.; var &c._scale_score ; ods output PearsonCorr=corr_&c._gr_&i.; run; data corr_&c._gr_&i.; set corr_&c._gr_&i.; grade=&i.; run; %end; %mend; %com (listening); %com (reading); %com (speaking); %com (writing);
... View more