I'd like to test hypothesis, where the difference between genders regards to writing ability.
My hypothesis is that females would have higher score than males.
And i was going to use 'proc glm' or 'proc reg' to test about it but the error says:
ERROR: Variable gender in list does not match type prescribed for this list.
So is it meaning that i can't use categorical variables to test hypothesis?
Here is my code:
proc reg data=temp;
model write = gender;
run;
All variables in the model statement need to be numeric. Try setting a new gender variable to, say, 0 for female and 1 for male.
Just add gender as a class variable and use PROC GLM:
proc glm data=temp;
class gender;
model write = gender;
run;
If your primary purpose is to conduct a t test for the difference of means, you can use PROC TTEST, which supports one- or two-sides tests of hypothesis. See the Getting Started example for PROC TTEST.
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!
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.