The openintro package contains a data set called bdims, which consists of the body dimensions of 507 physically active individuals. Complete a full multivariate regression analysis, predicting the variable wgt (weight) using all significant elements. You should do a stepwise variable selection procedure, and explore the data.
# Install the package
install.packages("openintro")
library(openintro)
# Data heading
head(bdims)
# Full model with all the covariates/independent variable
model<-lm(wgt~ ., data=bdims)
summary(model)
# From the out we see that many variables are non-significant
model2<-lm(wgt~ che.de + sho.gi+ che.gi+wai.gi+ hip.gi+
thi.gi+ for.gi+
kne.gi + cal.gi+ age+ hgt+ sex , data=bdims)
summary(model2)
# Histogram
hist(bdims$wgt)
hist(bdims$che.di)
hist(bdims$sho.gi)
hist(bdims$che.gi)
hist(bdims$wai.gi)
hist(bdims$hip.gi)
hist(bdims$thi.gi)
hist(bdims$for.gi)
hist(bdims$kne.gi)
hist(bdims$cal.gi)
Get Answers For Free
Most questions answered within 1 hours.