This is for assignment. But i am not asking for hold my finger and guide me. Just asking something that is confusing me.

I am reading a chapter in which we are using gg_resX(mydata) from lindia package. The value of mydata was calculated from mydata <- with(my_centered_data, lm(y ~ x)).

The output of this is following graph

enter image description here

The author of the tutorial then went on to say that there is no non-linear pattern here. Even though, to me, it appears that there is kind of a sin wave ..

Now, here is another graph

enter image description here

Should i consider that there is no pattern here as well? Or should i call it out that there are outliers at the bottom of the graph?

I mean, I am not sure why author said in first graph that it is linear and because of that i am confuse at second one

  • $\begingroup$ Can you post a link to the data itself, or just post the output of dput(data)? I cam see why you might observe a sinusoidal, but it's probably a bit too sparse and would be easy to "see" all kinds of things. $\endgroup$ – Robert Long Nov 15 '20 at 8:27
  • $\begingroup$ i am not sure if i am allowed to do so :( as i said its for assignment $\endgroup$ – Em Ae Nov 15 '20 at 16:02
  • $\begingroup$ What is being plotted in both of those figures ? Are they residuals from a model, or raw data ? $\endgroup$ – Robert Long Nov 15 '20 at 17:12

The plots appear to be for residuals vs fitted values, or perhaps against a predictor. This is a fairly standard approach to assessing linearity.

Basically we don't want to see any non-linear pattern in the plots.

The problem we have here is that the sample size is quite small. It looks like around 30. With this sample size it would be easy for a nonlinearity to be masked, or indeed to see a spurious nonlinear association.

I think you are justified in considering both plots to not show any clear evidence of nonlinearity.

Also, I would not pay too worry too much about apparent "outliers". Extreme data points occur naturally, it is only when something is clearly an error, such as a hieght of a human being 10cm, or 10m, that it should be removed.

  • $\begingroup$ Thanks a lot. you cleared my confusion. yeah, the sample size is 26 in first chart and 30 in second one. appreciate the time and comment. $\endgroup$ – Em Ae Nov 16 '20 at 2:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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