This is Lab 11 on Data Mining. It describes how one can use interaction terms in linear regression.
First we load the datamining
package and the data for the lab.
devtools::load_all() load('crash-head.rda')
The variables in the data set are described in the table below.
| Variable | Description | | --- | --- | | Head | Head injury to the dummy | | D.P | Dummy in the Driver or Passenger seat | | Protection Kind of protection: | Driver and passenger airbags (d&p airbags) | Driver-side airbag (d airbag) | Motorized belts, Passive belts, Manual belts | Doors Number of doors on the car (2 or 4) | Size Car weight/size category: | small, light, compact, midsize, heavy, SUV
head(x)
The dataset is the result of crash tests on 274 cars, ranging over 1987-1992 model years. For each test, an instrumented dummy was seated in the car and the car was crashed into a barrier at 35mph.
The data is contained in variable x. All of the variables except Head are categorical. Head has already been transformed with a logarithm to make its distribution symmetric.
Historical context: Around this time period, automatic protection was required by law, but auto makers strongly preferred automatic belts over airbags, despite mounting evidence that automatic belts were ineffective and sometimes worse than manual belts. Congress took up the issue, and eventually ruled in 1991 that all new cars starting in 1998 must have driver and passenger airbags.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.