Zeitreihenanalyse - Beispiel 1

From StatWiki
Jump to: navigation, search
> gdpa=readdataSK("GDPA.csv", "csv")
> gdpa=gdpa[-(1:20),]
>
> gdpa=data.frame(year=substr(gdpa$DATE,1,4), gdp=gdpa$VALUE)
>
> # plot(gdp~year, gdpa)
> # plot(1:10)</pre>


gdpa=transform(gdpa, lvalue=log(gdp), year=as.numeric(year))
plot(lvalue~year, data=gdpa)
GDP.ltrend=lm(lvalue~year, data=gdpa)
summary(GDP.ltrend)
abline(GDP.ltrend)

plot(gdpa$year, GDP.ltrend$residuals,xlab=" ",ylab=" ")