We will be looking at how you can do regression in R. More than one function call will do this, *lm()* and *ols()* in R. Don’t ask me why, I might find out another time.

Ordinary least squares regression:

— simple weights of predictor variable(s) are used to estimate values of the outcome variable — those estimated outcome values (predictions) should collectively minimize the squared discrepancies of the predicted values of the outcome compared to the observed values of the outcome variable

— such that any other set of weights would result in larger average discrepancy.

Cohen et al. (2003; p. 37), word for word.

But why *ols()* and *lm()*? In R, there is usually more than one way to skin a cat.

*Creative commons – flickr – LIGC-NLW: lion cubs, by John Dillwyn Llewelyn (taken 1854)*

Notice:

— I could not resist adding the photo.

### Like this:

Like Loading...

*Related*