Many people use heart-rate monitors when exercising in order to achieve target h
ID: 3157761 • Letter: M
Question
Many people use heart-rate monitors when exercising in order to achieve target heart rates for optimal training. A formula for the maximum safe heart rate has been advised by Sam Fox and William in 1970s, summarized by mhr = 220 - age. In 2001, Tanaka, Monahan, and Seals found that mhr = 209 - 0.7 * age_is a better fit for maximum safe heart rate. In this problem, we will simulate random data to check the validity and the assumptions for Tanaka, Monahan & Seals model. Use the following R-Code to simulate random data in order to fit a simple regression model for maximum heart rate (mhr) as a response to age. Set. speed(552010) age = rep(seq(18,65,by=l), 3) mhr= 209 - 0.7 *age morm(length(age),sd=4) Dt=data frame(age mhr) Write an R-code to perform all of the following: Find the correlation coefficient between age &mhr.; Which variable seems to be the explanatory? Which variable is the response? Obtain a scatter plot for mhr versus age. Using the correlation coefficient (2) and the scatterplot (4), describe the overall pattern for the relationship between age & mhr. Fit a simple linear regression model for mhr~ age. Obtain summary table and anova table for your model. Add the regression line on the graph. Interpret the regression model coefficients. Use your regression model to predict the maximum heart rate for a person aged 24 years.Explanation / Answer
Code:
set.seed(552010)
age=rep(seq(18,65,by=1),3)
mhr=209-0.7*age+rnorm(length(age),sd=4)
Dt=data.frame(age,mhr)
### [1] ###
r=cor(age,mhr)
r
### [3] ###
plot(mhr,age)
### [5] ###
fit=lm(mhr~age)
summary(fit)
anova(fit)
#### [7] ###
b=fit$coefficients
x=c(1,24)
ans=b%*%x
ans.
Explanation:
[2] Since heart rate depends on the increment of age, so response variable
will be mhr and explanatory variable will be age.
[4] Here we can see that the correlation coefficent is negative (r= -0.9189689)
and from the scatter plot we can see the slope of the regression line is negative.
So we can say that as one variable increases the other one will be decreased.
Since mhr is the dependent varible here so it will be better to say as age increases mhr will
decrease.
[6] Since the p-value(Pr(>|t|)) of both the intercept and the coefficient of age
is <0.05 so we can say that we need to include both of them in our model.
Here the coefficient of age is negative so it implies that if age increases mhr
will decrease.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.