BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
MarvelJJ
Calcite | Level 5

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;
1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
72
73 proc ttest h0=0 side=u;
74 class Eastern;
ERROR: Variable EASTERN not found.
75 var DIFF;
76 run;
 
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE TTEST used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
 
77
78 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
90
1 ACCEPTED SOLUTION

Accepted Solutions
PGStats
Opal | Level 21

Looks like you are trying to do:

 

proc ttest h0=0 side=u data=NHL1819;
	class Conference;
	var DIFF;
run;
PG

View solution in original post

2 REPLIES 2
PGStats
Opal | Level 21

Looks like you are trying to do:

 

proc ttest h0=0 side=u data=NHL1819;
	class Conference;
	var DIFF;
run;
PG
MarvelJJ
Calcite | Level 5

Thank you!  I am still pretty novice, so sometimes I make things harder than they should be.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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