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
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
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.