0

My questions is, that I see people using R´s lm() (linear regression model) with Y ~ X^2 e.g. here: Simple non-linear regression problem

But I dont see how and why it works, hence lm() is clearly stated as a linear estimator (using OLS), why does it work for quadratic, clearly non-linear estimation, as well?

Thank you.

Tw3Ak3r
  • 13
  • 3
  • 1
    If you let $Z=X^2$ then you have a simple linear regression of $Y$ on $Z$. Hence the name. The method does not care that you may have used a non-linear function of independent variables: it does not see that – Henry Aug 11 '19 at 21:07
  • Nitpick: `Y ~ X^2` is exactly the same as `Y ~ X`. You should study `help("formula")`. Apparently you eman `Y ~ I(X^2)`. – Roland Aug 12 '19 at 06:31
  • @Henry, but how can I interpret U-shaped relationships with the output of my lm regression, which tells me that, for instance, increasing X by one leads to an increase of Y bei 5? – Tw3Ak3r Aug 12 '19 at 12:34
  • @Tw3Ak3r If the output of your regression is that $Y \approx 5X^2+k$ then an increase of $X^2$ by $1$ (not an increase in $X$) is associated with an increase in $Y$ of $5$ – Henry Aug 12 '19 at 12:55

1 Answers1

1

lm fits linear models. In statistical parlance linear models are linear in the fitted parameter(s), often not in the independent variable(s). See, for example, Why is polynomial regression considered a special case of multiple linear regression?

user20637
  • 706
  • 4
  • 11
  • I dont get it. If the relationship between X and Y is U-shaped, how can estimating a straight line into this relationship explain my assumption? If I believe that Very high and low values of a variable have high influence, and only medium values of my variable have low influence (thus forming an "U" as in the sense of X^2), how can saying that "Increasing X by one Unit increases Y by 5 units" be correct ? (if Beta/coefficient of x = 5) Clearly this is not corect because high and low Values of X lead to high Y, whereas medium values of X lead to low values of Y. – Tw3Ak3r Aug 12 '19 at 12:30
  • Read my answer again, slowly. You have a very common beginner's misunderstanding. In statistics "linear model" does NOT mean linear in the predictor (X), i.e. it does NOT imply a straight line (rectilinear) relationship between Y and X. See, for example, [Wikipedia](https://en.wikipedia.org/wiki/Linear_model#Linear_regression_models) and note that "\phi _{1},\ldots ,\phi _{p} may be nonlinear functions". – user20637 Aug 12 '19 at 14:28