SAS Programming

DATA Step, Macro, Functions and more
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.

sas-innovate-white.png

Special offer for SAS Communities members

Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

Register now!

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
  • 692 views
  • 0 likes
  • 2 in conversation