Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- SAS Programming
- /
- SAS Procedures
- /
- Correlation Matrix

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

03-24-2018 04:17 PM

Hi there,

I have been using proc corr to conduct correlation matrix for continuous variables: "var" diagnosis rates (for 8 years) "with" volumes (for 8 years) - see below.

I want to do something similar for "var" diagnosis rates (8 years) "with" sex (m/f) and another categorical variable with 5 levels. Any suggestions for procedures to do a correlation matrix (var: 8 continuous, with categorical [2 levels and another variable with 5 levels])?

PROC CORR DATA=data.eva;

VAR rate_2009 rate_2010 rate_2011 rate_2012 rate_2013 rate_2014 rate_2015 rate_2016;

WITH tot_2009 tot_2010 tot_2011 tot_2012 tot_2013 tot_2014 tot_2015 tot_2016;

run;

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to kthartma

03-25-2018 02:42 AM

Do you want to create separate correlation matrices for each level of your categorical variable?

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to draycut

03-25-2018 11:37 AM

Hi,

I think so, I want it to be like:

Tot_2009 Tot_2010 Tot_2011 Tot_2012

Female

Male

If that makes sense. Let me know.

I think so, I want it to be like:

Tot_2009 Tot_2010 Tot_2011 Tot_2012

Female

Male

If that makes sense. Let me know.

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to kthartma

03-25-2018 11:50 AM - edited 03-25-2018 03:50 PM

@kthartma wrote:

Tot_2009 Tot_2010 Tot_2011 Tot_2012

Female

Male

If that makes sense. Let me know.

Actually, it doesn't make any sense to me. This is just words without description or meaning in the context of correlation of matrices.

The only thing that makes sense to me in the context of correlation matrices is to produce a correlation matrix for males and a different correlation matrix for females. If that's the case, sort by male/female, and then put a BY statement into your PROC CORR.

If that's NOT what you mean, please describe this in detail, instead of the rather brief descriptions you have given so far. **Show us an example of what you want.**

As long as we're discussing this, I don't see any reason to correlate rate2009 with tot_2016, for example, I can't image how this correlation of data 7 years apart would be meaningful.

--

Paige Miller

Paige Miller