I'm trying to use R for the first time. I am trying to evaluate possible shocks in a VAR model, so I can not develop the decomposition test. being my main questioning the message "time series has no period, or has less than 2"
At first I used the following code.
dados.ts <- ts(data = Lmacro$PIB, frequency = 1)
dados.ts.dec <- decompose(dados.ts, type = "mult")
Being Lmacro
, the logarithmic data of my model initially started with the variable PIB
.
Unfortunately, I do not know the other features of the function.
The spreadsheet has years identification, but I will not know how to associate or associate with the data.
Excel XLSX database. link
System Features:
R version 3.4.1 (2017-06-30)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)
Matrix products: default
locale:
[1] LC_COLLATE=Portuguese_Brazil.1252 LC_CTYPE=Portuguese_Brazil.1252
[3] LC_MONETARY=Portuguese_Brazil.1252 LC_NUMERIC=C
[5] LC_TIME=Portuguese_Brazil.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] vars_1.5-2 lmtest_0.9-35 urca_1.3-0 strucchange_1.5-1 sandwich_2.4-0
[6] zoo_1.8-1 MASS_7.3-49 Matrix_1.2-12
loaded via a namespace (and not attached):
[1] compiler_3.4.1 tools_3.4.1 nlme_3.1-131.1 grid_3.4.1 lattice_0.20-35
Thank you.