Live data from Hacker News

Abusing linear regression to make a point

goodmath.org

41–50 of 50 posts

Re: Abusing linear regression to make a point

#42

This article does not capture what is actually wrong with the regression. First, it's not necessarily wrong to fit a linear regression to data that might not be from a linear model, or that you know to be nonlinear. The data could be linear enough in the region of interest for the line to nonetheless be useful, for example. Sure, you need an underlying linear process if you want certain theorems and guarantees to app…

> First, it's not necessarily wrong to fit a linear regression to data that might not be from a linear model, or that you know to be nonlinear. The data could be linear enough in the region of interest for the line to nonetheless be useful, for example. Yes, very good point! Likewise regression is not robust to log transformations, but we still use log transformations (depending on the data) because we may be able to…

What do you mean it’s not robust to log transformations? A log transformation changes the inference to be about the conditional geometric mean, certainly (the log of an average of x is not equal to the average of a log(x)), but this is often quite sensible.

Re: Abusing linear regression to make a point

#43
post #6

> I said that if you had reason to believe in a linear relationship, then you could try to find it. That’s the huge catch to linear regression: no matter what data you put in, you’ll always get a “best match” line out. This challenge generalizes to all model fitting. Incorrectly assuming a distribution is Gaussian is a big one.

This is what stresses me out about people doing "bootcamp" data science courses and then getting jobs where they're given the responsibility of making decisions based on analysis of data.

Statistics is more involved than it appears, there are so many ways something can subtly violate underlying assumptions, or appear to be fine on the surface while being actually meaningless. It's really easy to fit a model, it's more involved and difficult to actually understand the complexities.

Re: Abusing linear regression to make a point

#44
post #14

This article does not capture what is actually wrong with the regression. First, it's not necessarily wrong to fit a linear regression to data that might not be from a linear model, or that you know to be nonlinear. The data could be linear enough in the region of interest for the line to nonetheless be useful, for example. Sure, you need an underlying linear process if you want certain theorems and guarantees to app…

Agreed. I was curious enough to run the model myself so I used a tool to extract the data. The slope estimate (b=17.24) is not significantly different from zero, p=.437. The data are here: https://pastebin.com/HhWTKZRb

> I used a tool to extract the data

You mean you have a tool for extracting tabula data from a scatter plot like http://www.goodmath.org/blog/wp-content/uploads/2020/07/EcCq... ? That's very cool and I would love to hear more about it.

Re: Abusing linear regression to make a point

#45

Next time I have to interview someone for an analyst position I will pick this article and say "find 5 mistakes within 5 minutes"...

I will remember this. Not the exact article, but the general spirit of knowing how to incorporate those endless statistics books/ articles/ resources into a tool I can use to detect errors. Maybe I'll even graduate to judging them.

Re: Abusing linear regression to make a point

#46
post #14

Earlier quoted context omitted.

Agreed. I was curious enough to run the model myself so I used a tool to extract the data. The slope estimate (b=17.24) is not significantly different from zero, p=.437. The data are here: https://pastebin.com/HhWTKZRb

The problem is that the author is essentially claiming that running the regression for data not passing his eyeball test is, in itself, a misuse of regression...which is nonsense.

Are you saying that eyeball tests are wrong? That's an extreme claim.

Re: Abusing linear regression to make a point

#47
post #14

Earlier quoted context omitted.

Agreed. I was curious enough to run the model myself so I used a tool to extract the data. The slope estimate (b=17.24) is not significantly different from zero, p=.437. The data are here: https://pastebin.com/HhWTKZRb

> I used a tool to extract the data You mean you have a tool for extracting tabula data from a scatter plot like http://www.goodmath.org/blog/wp-content/uploads/2020/07/EcCq... ? That's very cool and I would love to hear more about it.

There are quite a lot of these. Here is one I like: https://automeris.io/WebPlotDigitizer/

Re: Abusing linear regression to make a point

#48
post #14

This article does not capture what is actually wrong with the regression. First, it's not necessarily wrong to fit a linear regression to data that might not be from a linear model, or that you know to be nonlinear. The data could be linear enough in the region of interest for the line to nonetheless be useful, for example. Sure, you need an underlying linear process if you want certain theorems and guarantees to app…

Agreed. I was curious enough to run the model myself so I used a tool to extract the data. The slope estimate (b=17.24) is not significantly different from zero, p=.437. The data are here: https://pastebin.com/HhWTKZRb

What are some examples of data sets with high(ish) r with high p (low confidence), and low p (high confidence) with low r?

I guess it would be a very tall, "sharp cornered" parallelogram of data points (clear slope at the average, but high error variation), vs a very short, wide rectangle?

That would be a cool explorable demo.

Re: Abusing linear regression to make a point

#49

This person has no idea what they're writing about. Edited because my post was flagged (I'm not sure why). The definition of correlation coefficient is incorrect, which could have been attributed to a typo, except the author goes on to say "The bottom is, essentially, just stripping the signs away.", suggesting the square root of a sum of squared differences would be the same as the sum of differences, were it not fo…

What's the correct definition? (Aside from the "dependency" typo)

Re: Abusing linear regression to make a point

#50
post #46

Earlier quoted context omitted.

The problem is that the author is essentially claiming that running the regression for data not passing his eyeball test is, in itself, a misuse of regression...which is nonsense.

Are you saying that eyeball tests are wrong? That's an extreme claim.

Eyeball tests are often misleading, or fail to detect weak correlations (or deviations from model assumptions such as heteroskedasticity). That's why we check with more formal methods.
Post reply on HN