You are right, you can bet at 98.4% that there is a seasonality for t=4*k, and it value is +21108156. If the seasonality is assumed multiplicative rather than additive, you can get at 98.5%, that there is a seasonality and its value is +18.7%.
This is how I proceed, without using ready made package so that you can ask all kind of similar questions.
First introduce a new boolean variable dt$season = (dt$time %% 4)==0
, which is true (i.e =1) for t=0,4,8,... and false (i.e. =0) else where. Then the function x~a*season+b
is equal to a+b
for t=0,4,8,... and b
else where. In other words, a
is the difference between the seasonal effect and the non-seasonal effect.
The linear regression fit <- lm(units ~ season, data= dt)
, gives you a=21108156
, and summary(fit)
tells you the std-error an a
is 6697979, so that the observed value a=21108156
has a probability less than 0.0161 to appear in case it were 0. So, you can reasonably bet there is a 4 cycle seasonality with more than 1-0.0161=98.388% chances to be right.
If you assume the seasonality is multiplicative, use the same reasoning with the variable dt$mult = dt$units * dt$season
. This time a * dt$mult + b
is equal to a * dt$units + b
when the seasonality apply and to b
when it does not. So the seasonality brings a difference of a * dt$units
, that is multiply the average by a=.1877=18.77%
, with a significativity of 0.01471=1-98.5%
.
That's how ready made packages works.