tslm(Life_expectancy ~ Age + Gender + Race + trend, data=ts_df) 

Can I do something like this? I actually tried using this as a model and I got a different outcome but the p-value of trend variable was insignificant. Does that mean that there is no trend in my data?

I did the vif test. vif result


1 Answer 1


From my experience, trend variable is quite commonly used in time series regression. Especially in Demand Forecasting. I therefore can't see any problem using trend.

Having an insignificant p-value for the trend coefficient does not imply your dataset doesn't have any trend. There could be other reasons for that, the most immediate I can think of - a large sd for the trend coefficient.

To me, it might be that the trend and Age variables are correlated with each other, causing the trend p-value to shrink. I'd suggest measuring the VIF and correlation for your variables, focusing on examining the Age and trend relationship.

  • $\begingroup$ Thanks for the explanation. I did the vif test and it shows that the variables are highly correlated. So, what can I conclude from here? I am a bit confused here. My goal is actually to find the variables that have the most influence on life expectancy by using tslm. $\endgroup$ Jun 29, 2023 at 18:46
  • $\begingroup$ I'd suggest try to collect more data. It seems to me that your dataset is measured at a single point in time. If you can't, try feature selection. Remove Age\trend and see if it helps. Other approaches: instead of linear trend try using logarithmic, quadratic etc. trend. Those are the immediate solutions. $\endgroup$
    – Alex Teush
    Jun 29, 2023 at 19:20
  • $\begingroup$ Thanks for the explanation. Actually my objective is to fit tslm and lm model to my data set and select which model is suitable for time series data. But, I found out that both the models are the same unless I add variables trend for tslm() model. That's why I was asking whether I can include trend variable in my tslm model. $\endgroup$ Jun 30, 2023 at 5:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.