Activities: Week 3
Was there a COVID baby boom in Victoria?
The first Melbourne COVID-19 lockdown was from 31 March 2020 to 12 May 2020. We are interested in whether more babies than usual were born 9 months later — in January or February 2021.
First extract the data for Victoria from the aus_births
dataset.
This shows the number of births in Victoria each month from January 1975 to December 2021.
Now produce a time plot and a season plot of the data, to better understand the trend and seasonal patterns.
The see-saw seasonal pattern is due to month length variation.
So let’s remove it by taking the daily average of births in the month.
Now repeat the time and season plot, but using the daily average variable, rather than the monthly total.
- Has the peak month for having babies changed compared to the previous
gg_season
plot? Why? - Why has the unusual fluctuation after January 2020 apparently increased in size compared to the previous
gg_season
plot?
Let’s do an STL decomposition. Experiment with the value of window
and robust
to see how the seasonal component changes over time. We need robust = TRUE
here, so the unusual behaviour near the end of the series does not have a strong effect on the trend or seasonal components
With your preferred values of window
and robust
, plot the remainder component
Once we remove the trend and seasonal component, and just look at the remainder, we can see any effects that are not simply seasonality or trend. Here we are plotting the remainder for the last year.
How many extra births per month than normal were there in February 2021?
Canadian gas production
This exercise uses the canadian_gas
data (monthly Canadian gas production in billions of cubic metres, January 1960 – February 2005).
Try to find a Box-Cox transformation to stabilise the variance. Why isn’t it possible?
Without using a transformation, do a time plot, season plot and subseries plot to look at the effect of the changing seasonality over time.
Do an STL decomposition of the data. You will need to choose a seasonal window to allow for the changing shape of the seasonal component.
How does the seasonal shape change over time?
Can you produce a plausible seasonally adjusted series?
Canberra public transport usage
- Do Exam 2024, Question B2.