Estimate
2.9813
2.6364
4.1654
1.6763
(Intercept)
Bwt
SexM
Bwt:SexM
Std. Error
1.8428
0.7759
2.0618
0.8373
t value
1.62
3.40
2.02
2.00
Pr( t )
0.1080
0.0009
0.0453
0.0472
Table 1: Linear regression model for cats data.
2
2.5
3.5
20
Hwt
15
10
2.5
3.5
4
Bwt
Figure 1: The cats data from package MASS.
The Cats Data
Consider the cats regression example from Venables & Ripley (1997). The data
frame contains measurements of heart and body weight of 144 cats (47 female, 97
male).
A linear regression model of heart weight by sex and gender can be fitted in R using
the command
> lm1 = lm(Hwt ~ Bwt * Sex, data = cats)
> lm1
Call:
lm(formula = Hwt ~ Bwt * Sex, data = cats)
Coefficients:
(Intercept)
2.981
Bwt
2.636
SexM
-4.165
Bwt:SexM
1.676
Tests for significance of the coefficients are shown in Table 1, a scatter plot including
the regression lines is shown in Figure 1.