wc.at <- read.csv("C:\\Users\\Admin\\Downloads\\Data Sets\\Simple Linear Regression\\wc-at.csv")
attach(wc.at)
plot(Waist,AT) # Scatter plot

cor(AT,Waist) # Correlation ANalysis r (Correlation Coefficient)
## [1] 0.8185578
summary(wc.at)
## Waist AT
## Min. : 63.5 Min. : 11.44
## 1st Qu.: 80.0 1st Qu.: 50.88
## Median : 90.8 Median : 96.54
## Mean : 91.9 Mean :101.89
## 3rd Qu.:104.0 3rd Qu.:137.00
## Max. :121.0 Max. :253.00
sd(Waist)
## [1] 13.55912
var(AT)
## [1] 3282.69
model1 <- lm(AT ~ Waist)
summary(model1)
##
## Call:
## lm(formula = AT ~ Waist)
##
## Residuals:
## Min 1Q Median 3Q Max
## -107.288 -19.143 -2.939 16.376 90.342
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -215.9815 21.7963 -9.909 <2e-16 ***
## Waist 3.4589 0.2347 14.740 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 33.06 on 107 degrees of freedom
## Multiple R-squared: 0.67, Adjusted R-squared: 0.667
## F-statistic: 217.3 on 1 and 107 DF, p-value: < 2.2e-16