Fluorite | Level 6

How to denote different categories using proc corr?

Hi all,

I would like to perform a Spearman correlation on the scores from a single variable in my dataset. I have six other variables that categorize all participants into 6 different groups by giving them a 1 or a 0.

How can I use proc corr to say that I want to calculate the correlation coefficient on the scores for each different group as defined by the 6 other variables? An example table of what I am hoping for is below.

 Group 1 Group 2 Group 3 Group 4 Group 5 Group 6 Group 1 Correlation coefficient for score on test Group 2 Group 3 Group 4 Group 5 Group 6
5 REPLIES 5
Diamond | Level 26

Re: How to denote different categories using proc corr?

Please show us a portion of the original data

--
Paige Miller
Fluorite | Level 6

Re: How to denote different categories using proc corr?

Here is part of my dataset with the variables of interest.

Obs Score group1 group2 group3 group4 group5 group612345678

 71 1 . . 1 . . 20 . . . . . 1 29 . . . . . 1 44 . 1 . 1 . . 20 . 1 . 1 . . 63 1 . . 1 . . 50 . 1 . . . . 62 . 1 . 1 . 1
Fluorite | Level 6

Re: How to denote different categories using proc corr?

Here is the dataset with no formatting errors.

 Score Group1 Group2 Group3 Group4 Group5 Group6 71.00 1 . . 1 . . 20.00 . . . . . 1 29.00 . . . . . 1 44.00 . 1 . 1 . . 20.00 . 1 . 1 . . 63.00 1 . . 1 . . 50.00 . 1 . . . . 62.00 . 1 . 1 . 1
Super User

Re: How to denote different categories using proc corr?

Usually observations have to line up somehow....how do they align here? How do I know which group 4 obs to match with group 1, is it only when the observation has 1s in Group 4 and Group 1? But that doesn't make sense because you only have one value for that observation so how does correlation get calculated at all here?

Diamond | Level 26

Re: How to denote different categories using proc corr?

I have to admit I don't understand. A Spearman correlation cannot be calculated if the only values in the data are 1 or missing. Even if (as you said in your original message, but not in your most recent messge) that the values are 1 and 0, I don't see this as a candidate for a Spearman correlation. Correlation between two binary variables is measured by the Phi Coefficient, which is an output from PROC FREQ.

I'm also mystified by your title, "how to denote different categories", which doesn't seem to relate at all to anything you have written.

--
Paige Miller
Discussion stats
• 5 replies
• 568 views
• 0 likes
• 3 in conversation