Lab 1
Lab 1
Thulasi-2348152
2023-11-03
Introduction
The dataset consists of 26 observations with three variables: subject, weight, and systolic
blood pressure. In this report, we will perform a thorough analysis of the relationship
between weight and systolic blood pressure, including the construction of a scatter plot,
regression analysis, interpretation of regression results, and a comparison of fitted values
with observed values.
library(readxl)
regression <- read_excel("C:/Users/Admin/Downloads/regression.xlsx")
plot(regression$Weigth,regression$`Symbolic
BP`,col='red',xlab='Weight',ylab='systolic blood pressure',main='systolic
blood pressure and weight regression line')
cor(regression$Weigth,regression$`Symbolic BP`)
## [1] 0.7734903
The value of pearson coefficient r is 0.773,Which is a positive value closer to 1.Hence there
exist a linear relationship between weight and systolic presssure.
scatter.smooth(regression$Weigth,regression$`Symbolic BP`,col='red')
model<-lm(regression$`Symbolic BP`~regression$Weigth)
summary(model)
##
## Call:
## lm(formula = regression$`Symbolic BP` ~ regression$Weigth)
##
## Residuals:
## Min 1Q Median 3Q Max
## -17.182 -6.485 -2.519 8.926 12.143
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 69.10437 12.91013 5.353 1.71e-05 ***
## regression$Weigth 0.41942 0.07015 5.979 3.59e-06 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 8.681 on 24 degrees of freedom
## Multiple R-squared: 0.5983, Adjusted R-squared: 0.5815
## F-statistic: 35.74 on 1 and 24 DF, p-value: 3.591e-06
abline(lm(regression$`Symbolic BP`~regression$Weigth))
weight and systolic pressure are positively correlated since correlation is positive.weight is
independent variable and systolic pressure is dependent variable.Intercept is 69.10437
and regression coefficient of weight is 0.41942. A positive coefficient shows that as the
independent variable value increases, so does the mean of the dependent variable.
fit=fitted.values(model)
fit
## 1 2 3 4 5 6 7 8
## 138.3079 139.1467 144.5991 134.1137 158.0204 142.5020 148.7933 157.1816
## 9 10 11 12 13 14 15 16
## 152.9874 131.5972 135.3720 139.9855 140.4050 141.2438 135.7914 139.5661
## 17 18 19 20 21 22 23 24
## 142.0826 145.8574 159.2786 150.8903 144.5991 129.0807 169.7640 167.6669
## 25 26
## 149.6321 147.5350
sum(fit)
## [1] 3786
sum(regression$`Symbolic BP`)
## [1] 3786
Conclusion:
In summary, the analysis reveals a strong positive linear relationship between weight and
systolic blood pressure. The regression model fits the data well, and the sum of fitted
values matches the sum of observed values, indicating the model’s accuracy. This suggests
that weight is a significant predictor of systolic blood pressure, with an increase in weight
associated with higher systolic blood pressure.