Regression models; fitted model objects



next up previous contents
Next: Generic functions for Up: Statistical models in Previous: Defining statistical models;

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 and (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.



Erik Moledor
Tue Jan 31 21:02:18 EST 1995
x