I am attempting to test the actual average goal differential of the East conference is different form that of the West conference with proc ttest. I was able to get it to work in R (I can include my code for that if needed). I don't know if I am not splitting the data correctly into east and west or if something else is wrong with my code.
data work.NHL1819;
set work.Hockey;
run;
data work.hockey;
set work.nhl(where=(Conference='Eastern'));
run;
data work.hockey;
set work.nhl(where=(Conference='Western'));
run;
proc ttest h0=0 side=u;
class Eastern;
var DIFF;
run;
proc ttest h0=0;
class Eastern;
var DIFF;
Run;
Looks like you are trying to do:
proc ttest h0=0 side=u data=NHL1819;
class Conference;
var DIFF;
run;
Looks like you are trying to do:
proc ttest h0=0 side=u data=NHL1819;
class Conference;
var DIFF;
run;
Thank you! I am still pretty novice, so sometimes I make things harder than they should be.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.
Ready to level-up your skills? Choose your own adventure.