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.
Erik3
Calcite | Level 5

Hi, I want to test whether my gender variable effects my categorical variable, with levels say 1, 2 and 3, in any way. I've done tested the assumption for normality, it does not hold.  What PROC statement should I use to test independence between my variables now rather than the PROC TTEST? 

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

From your description, you have only categorical variables and so test of normality and t-tests are meaningless and also irrelevant.

 

It sounds like you want a chi-squared test from a simple contingency table using PROC FREQ.

--
Paige Miller

View solution in original post

3 REPLIES 3
PaigeMiller
Diamond | Level 26

From your description, you have only categorical variables and so test of normality and t-tests are meaningless and also irrelevant.

 

It sounds like you want a chi-squared test from a simple contingency table using PROC FREQ.

--
Paige Miller
Erik3
Calcite | Level 5
Thank you, yes this makes a lot more sense. My categorical variable, levels 1 2 & 3, is transformed from raw data using if statements. So if I worked with the raw data I had to test normality and equality of variance for both genders, and if those assumptions held, then test independence. But with only categorical data I'll use PROC FREQ immediately.
PaigeMiller
Diamond | Level 26

My categorical variable, levels 1 2 & 3, is transformed from raw data using if statements.

Normally, I advise against this.

 

 

So if I worked with the raw data I had to test normality and equality of variance for both genders, and if those assumptions held, then test independence.

Not sure what "independence" means in this context. But since you mentioned t-tests, normality and equality of variance are necessary, but the Satterthwaite t-test handles the case where the variances are different. If you have large amounts of data, then the central limit theorem takes care of normality, and makes the standard t-test reasonable. (And if you don't have a lot of data, there are bootstrap tests and also non-parametric tests available in SAS)

--
Paige Miller

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

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
  • 3 replies
  • 1292 views
  • 1 like
  • 2 in conversation