Regression models; fitted model objects

The basic function for fitting ordinary multiple models is lm(), and a streamlined version of the call is as follows:

fitted.model <- lm(formula, data=data.frame)

For example

fm2 <- lm(y x1 + x2, data=production)

would fit a multiple regression model of y on x1 and x2 (with implicit intercept term).

The important but technically optional parameter data=production specifies that any variables needed to construct the model should come first from the production data frame. This is the case regardless of whether data frame production has been attached to the search list or not.



Jeff Banfield
2/13/1998