BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Sandrapharma
Calcite | Level 5

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;

1 ACCEPTED SOLUTION

Accepted Solutions
Rick_SAS
SAS Super FREQ

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;

View solution in original post

3 REPLIES 3
PaigeMiller
Diamond | Level 26

@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.

--
Paige Miller
Rick_SAS
SAS Super FREQ

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
Calcite | Level 5

thanks. it has been resolved after i put both variables on the left of the model statement for GLM

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

What is ANOVA?

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.

Discussion stats
  • 3 replies
  • 1139 views
  • 7 likes
  • 3 in conversation