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

Hello, I have a binary/categorical variable - Location. I would like to see if there is a statistical difference between the presence of complaints between the two locations. 

 

For complaints I have the following values-

"." missing values denotes no complaint in the dataset.

1 denotes the presence of complaint

 

I was tilting towards using proc freq to do a chi-square test but wasn't sure. Can anyone please guide.

 

Here is the sample data.

 

data test;
infile datalines;
input customernum complaint location$;
datalines;

100   1  ND
200   .  D
300   1  D
400   1  D
500   .  ND
600   1  ND
700   1  D
800   1  D
900   .  ND
1000  1  ND
1100  1  D
1200  1  D
1300  1  D
;
RUN;

 

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

Proc Freq and Chi-sq would be one of my first choices. With the data you show you would need to include the MISSING option on the tables statement so that missing is treated as a category for the Complaint variable.

View solution in original post

1 REPLY 1
ballardw
Super User

Proc Freq and Chi-sq would be one of my first choices. With the data you show you would need to include the MISSING option on the tables statement so that missing is treated as a category for the Complaint variable.

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

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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