Modelling – ordinary least squares regression in R

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.

lion-cubs-CC-LIGC-NLW

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

Notice:

— I could not resist adding the photo.

This entry was posted in 15. Modelling - regression and tagged , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s