0

Fairly new to R, but I want to make a regression for data. I have the Years, the Container throughput and the GDP-levels of a certain country, and want to make a regression to get a formula to calculate the container throughput based on the predicted GDP levels. Can anyone help?

lmo
  • 37,904
  • 9
  • 56
  • 69
Savkeeeee
  • 33
  • 1
  • 4
  • 1
    Read about ARIMA modelling. Your question is too vague and broad for anyone to answer. – Kalees Waran Jul 03 '17 at 13:18
  • https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example – S Rivero Jul 03 '17 at 13:19
  • Sorry, try to explain it better: I've data from the years (1980-2015), the GDP levels and the numbers of containers which are imported in a certain country. However, I would like to forecast the number of containers that will be imported, based on the GDP levels, for future years. Therefore I first need the regression of the GDP and corresponding containerlevels, to see the intercept and the coefficient of GDP. How can I get them? – Savkeeeee Jul 03 '17 at 13:33

1 Answers1

1

You can fit the mathematical model using your data. For instance, use poly function to fit a polynomial of a certain degree, example: Fitting polynomial model to data in R

and use the obtained model on GDP grid.

There are many solutions really, depends on your preferences, needs, the data, etc.

Miroslav Radojević
  • 487
  • 1
  • 5
  • 20
  • I presume the airma modeling suggested above would be useful in GDP regression given year as that sounds suitable for timed data series (although there are really many options). And then there is the relation between GDP and container levels which you can plot and see which model fits the best. Assume: more GDP => more containers, but that you need to figure out yourself, plot the dependencies, see the data, come up with the math model that fits. In case there are tech questions related to R then you need to come up with the working example as others pointed. – Miroslav Radojević Jul 03 '17 at 15:00