weekday vs weekend average
Posted: Wed Jan 20, 2021 8:07 am
Hi all!
I'm working with several years of daily data, and I need to generate a dummy variables that is 1 if the average of weekend values is greater than the average of weekday values, and 0 for the opposite.
I figure I could start by creating a series that is the average of just the weekday values, and another that is the average of just the weekend values, then create a series using @recode that is 1 or 0 depending on the above inequality.
Is there a slick way to create these average series? Or, better yet, a better way to do this than my line of thinking?
Thanks!
Bob
I'm working with several years of daily data, and I need to generate a dummy variables that is 1 if the average of weekend values is greater than the average of weekday values, and 0 for the opposite.
I figure I could start by creating a series that is the average of just the weekday values, and another that is the average of just the weekend values, then create a series using @recode that is 1 or 0 depending on the above inequality.
Is there a slick way to create these average series? Or, better yet, a better way to do this than my line of thinking?
Thanks!
Bob