0
$\begingroup$

I am trying to do a simple linear regression of a scatterplot and it results in this:

enter image description here

So, the red line is the result I get, but I expect something more like the black line (drew it roughly). I use ordinary least square minimization and I understand that the black line would have huge residuals for the points on the far right of the plot for example. So it is clear why I do not get the result I want.

Now, I am wondering if there are other methods, for example using the perpendicular distance to the line rather than the vertical. Maybe you can throw me some buzz words or give me some ideas on what I could try.

$\endgroup$
4
  • 1
    $\begingroup$ For buzzwords try "Deming regression". en.wikipedia.org/wiki/Deming_regression $\endgroup$ Commented Mar 14, 2023 at 16:13
  • $\begingroup$ Why assume linearity, when you could instead use a nonparametric regression? $\endgroup$
    – Alexis
    Commented Mar 14, 2023 at 16:16
  • $\begingroup$ @Alexis I think that is a separate issue and that why the strictly linear fit looks so wrong is a legitimate question (one that seems to be answered quite well in the linked question). $\endgroup$
    – Dave
    Commented Mar 14, 2023 at 16:24
  • $\begingroup$ @Dave I think it is a reasonable comment in response to the title of Jailbone's question, and perhaps less of a separate issue. $\endgroup$
    – Alexis
    Commented Mar 14, 2023 at 16:28

0

Browse other questions tagged or ask your own question.