Skip to main content

5.2) Options For Linear Models


Of course, formulae can be a lot more complex than that. Type ?formula for more information, or go to the Html help file (Help menu > Html help > An Introduction to R), which has a good section on formulae for linear models.

Other arguments for lm() can include data=, to specify a data frame whose column names you have used in the formula (rather than first attaching the data frame or else prefixing the names with the data frame name plus $), and subset=, if you want to specify a subset of that data frame.

For help and examples, work through the exercises below. This could also be the time to start analysing some of your own data.