I want to run ols regression for time series data in R, but my data is short that is annual from 2000-2009. There are only 9 variables(2000-2009) and i collected data for inflation and exchange rate that how these variables between 2000-2009 affect gdp growth between 2000-2018. Is it ok for regression?
Theoretically you can still define the coefficients as the ones that minimize the sum of squared errors even with 9 data points. The problem is however that once you have estimated you will do practically nothing reliably like hypothesis testing, etc because the sample size is too short. Not to mention that if you work with time series data then your Error term is likely to be divergent from the OLS assumptions, so you should not use OLS because likely it will not be BLUE.. to give you a very very simple (albeit only partially correct) improvement GLS would likely be better. But as I said, it is only partially correct and for time series you should fit other kind of time series models estimated via MLE and taking into account the Heteroskedastic of the Error and the possible non-stationarity of data.. but I do not want to overcomplicate here because it seems that you are not working on time series