1. ## test of non-linearity

I am reading an interesting econometric book where the author suggests testing if non-linearity exist by specifying a quadratic term, if its significant than non-linearity exist. Obviously there are many types of non-linearity, will specifying this one term and testing its significance tell you if there is some form of non-linearity?

That seems too simple.

2. ## Re: test of non-linearity

There is a specific test for lack of fit which uses the oposite logic. If your model is linear and the lack of fit is significant then obviously we have a nonlinearity. If the model has interaction terms for instance then the lack of fit means "more nonlinear" then what the interaction implies.

regards

3. ## Re: test of non-linearity

Well, there are a few ways to think about this - for any given particular design. For example, the classical easy case would be Y=Performance and regressed on X=Anxiety. This case has been demonstrated - time and again - that X^2 (Anxiety^2) should be included into the regression model.

Another way to think about this is in an ANOVA/Regression context: That is, R^2 in an ANOVA context provides the Correlation Ratio (think of, say 4 groups, with 3 dummy vectors), whereas the R^2 from the regression context, with one X, provides the linear relationship between the dependent variable (Y) and X (X is quantitative). The difference between the Correlation Ratio and the R^2 from a linear regression analysis is referred to as the "Deviation from Linearity". That s aid, typically a hierarchical approach is taken to approach the problem i.e., linear, quadratic, cubic, quartic.....but seldom does research go beyond a quadratic fit.

The same can be said in the context of what is called "Trend Analysis."

And, interaction terms are also relevant in the context of an IV (X) which can be considered as a "Moderating Variable."

Summary: It's all about the context and what prior research has demonstrated for any given research topic.

4. ## Re: test of non-linearity

Do you remember posting on the Ramsey reset test? Same concept.

5. ## Re: test of non-linearity

Originally Posted by rogojel
There is a specific test for lack of fit which uses the oposite logic. If your model is linear and the lack of fit is significant then obviously we have a nonlinearity. If the model has interaction terms for instance then the lack of fit means "more nonlinear" then what the interaction implies.

regards
Is this box-tidwel? If so it appears that can only be used with logistic regression.

6. ## Re: test of non-linearity

I will look at the Ramsey reset test.

Dragan there is almost no theory in the area I am working. The vocational rehabilitation literature is extremely thin on empirical methods. Think social work...

7. ## Re: test of non-linearity

Originally Posted by noetsi
I am reading an interesting econometric book where the author suggests testing if non-linearity exist by specifying a quadratic term, if its significant than non-linearity exist. Obviously there are many types of non-linearity, will specifying this one term and testing its significance tell you if there is some form of non-linearity?

That seems too simple.
Yeah, it's too simple. Non-linear relationships come in many flavours other than the quadratic (including non-polynomial forms, so the Ramsey reset test isn't a complete solution either). I don't know of a general test for any kind of unmodelled linearity though.

8. ## Re: test of non-linearity

I thought one of the good things about straight up OLS regression is that one can plot the residuals and look for patterns there?

I mean it's not an exact formal test but it's definitely something nice to look at.

9. ## Re: test of non-linearity

I don't think I have encountered non-polynomial versions.

10. ## Re: test of non-linearity

Originally Posted by spunky
I thought one of the good things about straight up OLS regression is that one can plot the residuals and look for patterns there?

I mean it's not an exact formal test but it's definitely something nice to look at.
You can, but my data commonly has 10,000 points or more so even plotting partial regression plots to test non-linearity (as recommended) commonly results in large blobs of data. Its not easy to see any pattern in that, which is why I was looking for a formal test.

11. ## Re: test of non-linearity

Originally Posted by noetsi
You can, but my data commonly has 10,000 points or more so even plotting partial regression plots to test non-linearity (as recommended) commonly results in large blobs of data. Its not easy to see any pattern in that, which is why I was looking for a formal test.
Stolen from Dason's chatbox post because I'd like to keep this for posterity:

http://blogs.sas.com/content/iml/201...rplotting.html

12. ## The Following User Says Thank You to spunky For This Useful Post:

noetsi (06-28-2016)

13. ## Re: test of non-linearity

Originally Posted by noetsi
You can, but my data commonly has 10,000 points or more so even plotting partial regression plots to test non-linearity (as recommended) commonly results in large blobs of data. Its not easy to see any pattern in that, which is why I was looking for a formal test.
Have you tried sorting the residuals then sampling every ith point (say every 100th point)? I know it sounds crude, but it would get rid of the "blob" effect and allow you to see a pattern.

14. ## The Following 2 Users Say Thank You to Miner For This Useful Post:

hlsmith (06-28-2016), noetsi (06-28-2016)

15. ## Re: test of non-linearity

Originally Posted by Miner
Have you tried sorting the residuals then sampling every ith point (say every 100th point)? I know it sounds crude, but it would get rid of the "blob" effect and allow you to see a pattern.
I have considered it many times. I was not sure if its valid to sample randomly this way to test the residuals...You appear to be saying it is.

16. ## Re: test of non-linearity

It would not be random. Sort first then sequentially sample. Remember, you are not performing a statistical test here. You are interpreting the residuals for patterns, namely curvature. This just thins out the blob.

Also, someone mentioned code for a heat map in another post. This might help you see a pattern even through the blob.

17. ## The Following User Says Thank You to Miner For This Useful Post:

noetsi (06-28-2016)

18. ## Re: test of non-linearity

I missed you were talking about stratified sampling. Hlsmith sent me how to do heat lamps - and I got swamped. Need to go back and find that.