- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I have several categorical variables like gender, race, etc. where I want to find the mean of each category. For example my variable is race and race=1 means white, race=2 means Black, race=3 means Asian/PI. I want to find the mean number of people in my dataset who are members of each race, as well as the standard deviation. Would I use PROC FREQ for this or PROC MEANS?
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
If I am understanding you properly, you run PROC FREQ first to count the number of people in each race, and create an output data set. Then you take this output data set into PROC MEANS and compute the mean and standard deviation.
Paige Miller
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
If I am understanding you properly, you run PROC FREQ first to count the number of people in each race, and create an output data set. Then you take this output data set into PROC MEANS and compute the mean and standard deviation.
Paige Miller
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Could you please write the code for that?
I understand what you mean. But I can't write the code as you are doing.
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I do not understand what you want.
It sounds like you want to count and take the mean of the counts.
But you don't need to do that as the mean of the counts is just the total number of observations divided by the number of distinct values.
For example if you had GENDER coded as M and F there are two gender categories. So the mean of the count of people per category is N/2.
What do intend to DO with this mean? What value would a SD add?