- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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;
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@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
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
thanks. it has been resolved after i put both variables on the left of the model statement for GLM