Non-graphical linearity estimation

In my previous post, I looked for correlation procedures (& eta; or 2 ) in R. I was surprised that no one was using & eta; to verify linearity in GLM procedures.

Let's start with a simple example: how do you check the linearity of two-dimensional correlation? Exclusively with a scatter chart?

There are several ways to do this, one way to compare the linear and non-linear model of R 2 is then apply the F-test to find the significant difference between them.

Finally, the question arises: how do you check linearity, the “non-graphical” way?

+3
source share
2

- , ( ). .

model1<-lm(yv~xv)
model2<-lm(yv~xv+I(xv^2)) #Even if we restrict ourselves to the inclusion of a quadratic term, there are many curves we can describe, depending upon the signs of the linear and quadratic terms

anova(model1,model2)

Analysis of Variance Table

Model 1: yv ~ xv
Model 2: yv ~ xv + I(xv^2)
  Res.Df    RSS Df Sum of Sq      F Pr(>F)  
1     16 91.057                             
2     15 68.143  1    22.915 5.0441 0.0402 *

(p = 0,04), , .

+5

RESET ( ) , . LMTEST - . , . , , / .

+4

Source: https://habr.com/ru/post/1749377/


All Articles