3 Exercise 1: Multiple linear regression
Hydrostatic weighing, also known as underwater weighing or hydrodensitometry, is one of the most accurate ways to measure body fat.
The body fat of 78 high school wrestlers was measured using three separate techniques, namely hydrostatic weighing, skin fold measurements and the Tanita body fat scale. The results are stored in the data set HSwrestler
in the PASWR
package.
Read in the data using:
The data set contains nine columns, described as follows:
AGE
: age of wrestler in yearsHT
: height of wrestler in inchesWT
: weight of wrestler in poundsABS
: abdominal fatTRICEPS
: tricep fatSUBSCAP
: subscapular fatHWFAT
: hydrostatic fatTANFAT
: Tanita fatSKFAT
: skin fat
This can be seen by typing:
In this example, it is of interest to investigate how hydrostatic fat (HWFAT
) is related to abdominal fat (ABS
) and tricep fat (TRICEPS
).
3.1 Exploratory analysis
TASK 1
- Produce scatterplots of
HWFAT
(y) against LacticABS
(x), andHWFAT
(y) againstTRICEPS
(x).
You can use plot()
such as in the previous example with Grades. Or you can refer to previous weeks labs and use ggplot()
.
- Describe the relationship between
HWFAT
(y),ABS
(x) andTRICEPS
.
3.2 Fitting a linear model
In Example 1, the function lm()
was used to find estimates for parameters of a simple linear regression model. The same function can be used for multiple linear regression models by specifying the explanatory variables on the right side of the tilde (~) operator inside the lm()
function.
To build a multiple linear regression model with hwfat
as the response variable and abs
and triceps
as explanatory variables, type:
Note down the equation of the fitted line from that is given:
HWFAT
= + ABS
+ TRICEPS
QUESTION: Interpret what each coefficient means.
For every unit increase in abdominal fat, hydrostatic fat is expected to by unit, .
For every unit increase in tricep fat, hydrostatic fat is expected to by unit, .