Turn on suggestions

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

Showing results for

- Home
- /
- Analytics
- /
- Stat Procs
- /
- Re: How to denote different categories using proc corr?

Options

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

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Posted 09-08-2020 05:32 PM
(572 views)

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

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Please show us a portion of the original data

--

Paige Miller

Paige Miller

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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

Obs Score group1 group2 group3 group4 group5 group612345678

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 |

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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 |

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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

Paige Miller

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. **Registration is now open through August 30th**. Visit the SAS Hackathon homepage.

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.