BookmarkSubscribeRSS Feed
hz16g22
Obsidian | Level 7

I am trying to do this question for my assignment, but I don't think im doing it in the best way. 

This is the question:

hz16g22_0-1678892175414.png

and this is how i did it 

46   proc freq data=lib.dresses;
47       tables Season Style SleeveLength Neckline Waistline;
48   run;

 The reason I think it's really off is because it keeps telling me there's missing frequencies for some of the variables:

hz16g22_1-1678892284522.png

Is there a better way to do this?

 

1 REPLY 1
ballardw
Super User

It depends on what you want.

Missing results in proc freq means that you do have missing values in the variable. Proc Freq is well tested and just because you think there aren't any missing values does not mean they aren't in the actual data.

 

Run this code to create a data set where you can see which observations in that data set have missing values for the Waistline variable.

data temp;
   set lib.dresses;
   where missing(waistline);
run;

You can place * between variables on the tables statement to see how two (or more) variables interact in the data. You could add the option Missing to the tables statement so the row in the table shows the missing values instead of the note at the end of table.

This shows a simple listing of the combinations of neckline and waistline with the missing included.

proc freq data=lib.dresses;
      tables Neckline * Waistline / missing list;
 run;

Consider: If a dress does not have any sleeves what value would expect to see for Sleevelength? A value of 0 would imply that there was a sleeve but the length was 0, which seems odd to me.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 709 views
  • 1 like
  • 2 in conversation