How to understand AFD-Results

Hi, I'm quite new into R-programming. I'm about to create a forecast for a month sales of bicycles.

I've done a ADF test to see if the serie is a stationary or not. But I don't really understand what the results say's.

Here is my code:

Month_Sales <- read.csv("MonthSales.csv")

glimpse(Month_Sales)
Observations: 38
Variables: 5
X <int> 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, ... Month 2017-01-01, 2017-02-01, 2017-03-01, 2017-04-01, 2017-05-01, 2017-06-01, 2017-07-01, 2017-08-01...
TotBelopp <int> 8310978, 10601552, 27653825, 32479458, 34549282, 30153213, 27954680, 32260115, 21024926, 153669... TotBelopp_Knw 5944227, 7782916, 21132752, 24236297, 25042329, 22242254, 19945128, 23520821, 15740065, 1099808...
$ TotBelopp_Unkw 2366751, 2818636, 6521073, 8243161, 9506953, 7910959, 8009552, 8739294, 5284861, 4368820, 38762...

Convert the Month to date

Month_Sales$Month <- as.Date(as.character(Month_Sales$Month))

Creating a time serie for unknown customers

tserie_Unkn <- ts(Month_Sales$TotBelopp_Unkw, frequency = 12)

counting the observations

Month_Sales %>% summarise(n = n())

Splitting up the data into training & testing part

train <- ts(tserie_Unkn[1:32], frequency = 12)
eval <- tserie_Unkn[33:38]

df_decomp <- decompose(train)
plot(train)

library(urca)

Running the ADF test

summary(ur.df(train, type = "trend", lags = 10, selectlags = "BIC"))

Show in New WindowClear OutputExpand/Collapse Output
n

38
1 row
Show in New WindowClear OutputExpand/Collapse Output
n

38
1 row
Show in New WindowClear OutputExpand/Collapse Output

###############################################

Augmented Dickey-Fuller Test Unit Root Test

###############################################

Test regression trend

Call:
lm(formula = z.diff ~ z.lag.1 + 1 + tt + z.diff.lag)

Residuals:
Min 1Q Median 3Q Max
-6028679 -1580479 820105 1340663 4113348

Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 2.221e+06 2.240e+06 0.992 0.33520
z.lag.1 -8.261e-01 2.764e-01 -2.989 0.00825 **
tt 1.670e+05 1.120e+05 1.492 0.15415
z.diff.lag 2.192e-01 2.371e-01 0.925 0.36815

Signif. codes: 0 ‘’ 0.001 ‘’ 0.01 ‘’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 2716000 on 17 degrees of freedom
Multiple R-squared: 0.3695, Adjusted R-squared: 0.2582
F-statistic: 3.321 on 3 and 17 DF, p-value: 0.04484

Value of test-statistic is: -2.9887 3.0832 4.4673

Critical values for test statistics:
1pct 5pct 10pct
tau3 -4.15 -3.50 -3.18
phi2 7.02 5.13 4.31
phi3 9.31 6.73 5.61

Would be very helpful if someone can explain what kind of figures I should concentrate on.

Many thanks in advance :slightly_smiling_face:

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.