# Regression: Why does using quadratic expressions work with linear estimators? [duplicate]

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.

## marked as duplicate by Glen_b♦ r StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); Aug 11 at 23:24

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

• 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 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 at 6: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 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 at 12:55

## 1 Answer

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?

• 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 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 and note that "\phi _{1},\ldots ,\phi _{p} may be nonlinear functions". – user20637 Aug 12 at 14:28