BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Kimberly_2020
Calcite | Level 5

"Create a frequency table of current gender and sexual orientation for patients between the age of 18 - 50 years" was my instructions...I want to know if my output is correct. Please see attachment. 

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

Typically when a phrase like "between the age of 18 - 50 years" is used then the data should be subsetted to that range, typically with a Where statement or data set option. Your frequencies for Age don't show any ages outside that range so go so far.

 

However you apparently have multiple "gender" variables and we have no way of knowing which is the "current" value. From the request, that is the only one that should be used.

Since the request says "a frequency table of current gender and sexual orientation " I would normally interpret that as meaning first, one table, not 6 plus and graphs, and second that you have gender and orientation in a single table. If race is not part of the request do not include it, if required then describe how race is supposed to be included.

 

In Proc Freq that would be a Tables statement like: Tables genderc*sex_o;

 

With the stated requirement and the shown output, if I were grading this as an assignment it would likely get a D because no where do you have gender and orientation together.

 

If the requirement does not want graphs then turn of the graphs before running proc freq.

View solution in original post

1 REPLY 1
ballardw
Super User

Typically when a phrase like "between the age of 18 - 50 years" is used then the data should be subsetted to that range, typically with a Where statement or data set option. Your frequencies for Age don't show any ages outside that range so go so far.

 

However you apparently have multiple "gender" variables and we have no way of knowing which is the "current" value. From the request, that is the only one that should be used.

Since the request says "a frequency table of current gender and sexual orientation " I would normally interpret that as meaning first, one table, not 6 plus and graphs, and second that you have gender and orientation in a single table. If race is not part of the request do not include it, if required then describe how race is supposed to be included.

 

In Proc Freq that would be a Tables statement like: Tables genderc*sex_o;

 

With the stated requirement and the shown output, if I were grading this as an assignment it would likely get a D because no where do you have gender and orientation together.

 

If the requirement does not want graphs then turn of the graphs before running proc freq.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 475 views
  • 0 likes
  • 2 in conversation