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.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and save with the early bird rate—just $795!
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.