inst/examples/R/stat/PeriodischeSchwankung/Decomposition_PKW.R

a = c(15222, 17456, 12988, 13833, 15407, 19110, 13479, 13139, 16407, 18738, 11923, 11853, 15869, 16109, 12883, 11712, 14495, 15373, 10341, 11111, 12985, 13397, 9474, 10043, 13431, 15968, 11246, 11261, 14908, 14581, 10498, 10657, 11078, 14858, 11473, 12384, 13801, 17143, 14249, 14712, 12603, 16799, 15611, 15568, 13077, 17098, 14159, 13085, 14093, 16344, 12044, 13762)
t = ts(a, start=c(1977,1), end=c(1989,4), fr=4)
plot(t, xlab="Period", ylab="amount of cars*E3", type="l", ylim=c(-5000, 20000), lwd=2, yaxt="n")
axis(2, at=seq(-5000, 20000, by=5000), label=seq(-5, 20, by=5))
lines(decompose(t)$trend, col="green", lwd=2)
lines(decompose(t)$seasonal, col="blue", lwd=2)
lines(decompose(t)$random, col="red", lwd=2)
sigbertklinke/shinyExample documentation built on May 26, 2019, 4:32 a.m.