require(mosaic)
require(car)
Researchers observed the following data on 20 individuals with high blood pressure:
BP
, in mm Hg)Age
, in years)Weight
, in kg)BSA
, in m^2
)Dur
, in years)Pulse
, in beats per minute)Stress
)Our goal is to build a model for blood pressure as a function of (some subset) of the other variables. In this case all of our variables are quantitative, so we can get a quick look at their relationships using the a pairs plot.
BP <- read.csv("http://www.math.smith.edu/~bbaumer/mth247/labs/bloodpress.csv")
pairs(BP)
# Better than the standard pairs plot is the generalized pairs plot.
#install.packages("gpairs")
#gpairs(BP)
BP
?Hint: use
cor
to calculate the correlation coefficient matrix.
Weight
seems to be highly correlated with BP
, so as a first step, we should understand how well a simple linear model for blood pressure as a function of weight works. Keep in mind that it accords with our intuition that there would be a strong link between a person’s weight and their blood pressure.
xyplot(BP ~ Weight, data=BP, pch=19, alpha=0.5, cex=1.5, type=c("p", "r"))