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

I have data recorded from football games over the years that has game date, winning team, winning score, losing team, and losing score.

 

1. How do I create a variable that will calculate the difference in points between the two teams?

2. How do I present the game date using a format that includes the day of the week?

3. How do I create a cumulative counter variable that tracks the total number of bowl games?

4. How do I create a cumulative counter variable that tracks the number of wins for each team?

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

@collegestudent2 wrote:

 

 

1. How do I create a variable that will calculate the difference in points between the two teams?

 


https://video.sas.com/detail/videos/sas-analytics-u/video/4573023399001/creating-a-new-column-in-sas...

 


2. How do I present the game date using a format that includes the day of the week?

 


https://video.sas.com/detail/video/4572997796001/formatting-values-in-sas?autoStart=true&q=format

 


3. How do I create a cumulative counter variable that tracks the total number of bowl games?

4. How do I create a cumulative counter variable that tracks the number of wins for each team?


https://stats.idre.ucla.edu/sas/faq/how-can-i-create-an-enumeration-variable-by-groups/

 

Links above contain tutorials under 5 minutes each to answer your questions. If you still need help, please post your code and explain what issues you're having please.

View solution in original post

4 REPLIES 4
PaigeMiller
Diamond | Level 26

@collegestudent2 wrote:

I have data recorded from football games over the years that has game date, winning team, winning score, losing team, and losing score. The data is from a bowl game, so only two teams. 

 

1. How do I create a variable that will calculate the difference in points between the two teams?


It sure would help if you showed us a portion of your data.

--
Paige Miller
collegestudent2
Fluorite | Level 6

The Data: 

Capture.PNG

PaigeMiller
Diamond | Level 26

It looks like a homework problem ... is it? Show us what you have tried so far.

--
Paige Miller
Reeza
Super User

@collegestudent2 wrote:

 

 

1. How do I create a variable that will calculate the difference in points between the two teams?

 


https://video.sas.com/detail/videos/sas-analytics-u/video/4573023399001/creating-a-new-column-in-sas...

 


2. How do I present the game date using a format that includes the day of the week?

 


https://video.sas.com/detail/video/4572997796001/formatting-values-in-sas?autoStart=true&q=format

 


3. How do I create a cumulative counter variable that tracks the total number of bowl games?

4. How do I create a cumulative counter variable that tracks the number of wins for each team?


https://stats.idre.ucla.edu/sas/faq/how-can-i-create-an-enumeration-variable-by-groups/

 

Links above contain tutorials under 5 minutes each to answer your questions. If you still need help, please post your code and explain what issues you're having please.

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