I am trying to calculate the pearson partial correlation between continuous variables, x and y adjusted by continuous variable z. based on this article https://www.lexjansen.com/pharmasug/2010/SP/SP01.pdf, the following two procedure will give the same results (Pearson correlation from PROC CORR will be the same as the sqrt(R Square) from PROC GLM. However, I always got different results. I am wondering why and which one I should use to calculate the partial correlation.
PROC CORR data = adqol;
var y;
with x;
partial z ;
run;
PROC GLM data=adqol;
model y = x z;
manova / printE;
run;
quit;
I don't think your PROC GLM step is correct. You need to put both variables on the left hand side of the MODEL statement. Try this:
PROC CORR data = sashelp.class;
var Weight;
with Height;
partial Age;
run;
PROC GLM data=sashelp.class plots=none;
model Weight Height = Age;
manova / printE;
run;
quit;
@Sandrapharma wrote:
I am trying to calculate the pearson partial correlation between continuous variables, x and y adjusted by continuous variable z. based on this article https://www.lexjansen.com/pharmasug/2010/SP/SP01.pdf, the following two procedure will give the same results (Pearson correlation from PROC CORR will be the same as the sqrt(R Square) from PROC GLM. However, I always got different results. I am wondering why and which one I should use to calculate the partial correlation.
Show us the results.
I don't think your PROC GLM step is correct. You need to put both variables on the left hand side of the MODEL statement. Try this:
PROC CORR data = sashelp.class;
var Weight;
with Height;
partial Age;
run;
PROC GLM data=sashelp.class plots=none;
model Weight Height = Age;
manova / printE;
run;
quit;
thanks. it has been resolved after i put both variables on the left of the model statement for GLM
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.