You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
500 B
25 lines
500 B
3 years ago
|
install.packages("WDI")
|
||
|
library(WDI)
|
||
|
|
||
|
gdp = WDI(country = "KR", indicator = c("NY.GDP.PCAP.CD", "NY.GDP.MKTP.CD"), start = 1960, end = 2017)
|
||
|
|
||
|
head(gdp)
|
||
|
names(gdp) = c("country", "iso2c", "iso3c", "year", "perCapGDP", "GDP")
|
||
|
head(gdp)
|
||
|
|
||
|
kr = gdp$perCapGDP[gdp$country=="Korea, Rep."]
|
||
|
kr
|
||
|
|
||
|
kr = ts(kr, start=min(gdp$year), end=max(gdp$year))
|
||
|
kr
|
||
|
|
||
|
install.packages("forecast")
|
||
|
library(forecast)
|
||
|
|
||
|
krts = auto.arima(x=kr)
|
||
|
krts
|
||
|
|
||
|
forecastResult = forecast(object=krts, h=5)
|
||
|
forecastResult
|
||
|
|
||
|
plot(forecastResult)
|