#Question 1
library(readxl)
Avg_Body_Data <- read.csv ("C:/Users/kenzl/OneDrive/Documents/AvgBodyData (1).csv")
model1 <- lm(Weight ~ Height , data = Avg_Body_Data)
summary(model1)
##
## Call:
## lm(formula = Weight ~ Height, data = Avg_Body_Data)
##
## Residuals:
## Min 1Q Median 3Q Max
## -28.97 -17.81 0.46 10.75 69.71
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -140.4028 76.3790 -1.838 0.07705 .
## Height 1.2993 0.4427 2.935 0.00674 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 21.45 on 27 degrees of freedom
## Multiple R-squared: 0.2419, Adjusted R-squared: 0.2138
## F-statistic: 8.614 on 1 and 27 DF, p-value: 0.006736
observations_for_pred = data.frame(Height = c(175.8), Height = c(185.9) )
observations_for_pred
## Height Height.1
## 1 175.8 185.9
predict(model1, observations_for_pred, type = "response")
## 1
## 88.01163
predict(model1, observations_for_pred, interval = "prediction", level = 0.90, type = "response")
## fit lwr upr
## 1 88.01163 50.74974 125.2735
confint(model1, level = 0.90)
## 5 % 95 %
## (Intercept) -270.4982539 -10.30740
## Height 0.5452317 2.05334
1b Weight = 1.1838 (Height) +
1c
Yes, there is a statistically significant relationship.
1d 0.006736
1e 21.38%
1f Yes, I do believe the regression line fits the data well, because there is little variation.
1g There is a 90% probability that the actual value of B1 lies between 50.74974 and 125.32735.
1h There is a 90% probability that the actual value of B2 lies between 50.74974 and 125.32735.
#Question 2
#Question 3