3
$\begingroup$

I want compare the out of sample prediction from an linear regression model (OLS) and a regression tree. I read that OLS outperforms regression tree if the relationship between the dependent variable and independent variables is strongly linear.

How I can check the linear relationship between dependent and independent variables?

$\endgroup$
5
  • 2
    $\begingroup$ I dont understand why this question get a downvote... $\endgroup$ Commented May 21, 2019 at 15:43
  • $\begingroup$ ols = ordinary least squares? $\endgroup$
    – Scholar
    Commented May 29, 2019 at 13:03
  • $\begingroup$ @bi_scholar yes $\endgroup$ Commented May 30, 2019 at 9:27
  • $\begingroup$ "I want compare the out of sample prediction" - maybe I am missing something, but why don't you simply compare the out of sample prediction? If you don't have a source of out of sample data, cross validation is a useful approximation. Checking the linear relationship is just a very indirect proxy for the actual prediction task. $\endgroup$ Commented May 30, 2019 at 11:13
  • $\begingroup$ with out of sample prediction i mean i have a test set $\endgroup$ Commented May 30, 2019 at 12:15

2 Answers 2

7
$\begingroup$

A better approach is to think hard about the model specification and to seldom assume linearity, as it is unusual for variables to be linearly related to each other. With very small sample sizes we must sometimes force a linearity assumption because we can't do much else without penalized maximum likelihood estimation.

Making scatterplots isn't always a good idea as if you are using classical frequentist methods, using observed relationships will distort p-values and confidence intervals and also cause overfitting of the model.

My Regression Modeling Strategies book and course notes and accompanying R package rms go into great detail about this, and shows how to use regression splines to relax linearity assumptions.

Single regression trees are not competitive with regression and they do not properly handle continuous variables.

$\endgroup$
2
  • $\begingroup$ That's why i tried to test for linearity assumption because i compared a regression tree with a ols regression and get better prediction with the ols model. I read that when the dependent variable and the independent variable have strong linear relationship that the ols regression outperforms the regression tree i terms of prediction so i searched ways to show this strong linear relationship or tried to explaine why ols outperform the regression tree $\endgroup$ Commented May 30, 2019 at 12:19
  • $\begingroup$ You missed all my points. Please re-read. $\endgroup$ Commented May 30, 2019 at 17:18
1
$\begingroup$

Your question is not very clear. But still you can check the linearity between the independent and dependent variables by plotting them as scatter plots. Scatter plots will give you a very good idea about the linearity of the variables. You will have to plot multiple scatter plots for each independent variables keeping the dependent variable constant.

$\endgroup$

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.