Nischay Bikram Thapa
S3819491
The dataset presented here includes the correspondence between body build, weight, and girths in a group of physically active young men and women, most of whom were within the normal weight range.
The measurement is taken on the 247 men and 260 women in the dataset. These were primarily individuals in their twenties and early thirties, with a scattering of older men and women, all physically active (several hours of exercise a week)
Looking at the summary statistics, it is evident that a person chest diameter is 27.97 on average with a range from 25.65 to 29.95. Similarly, for the height of a person, the average is recorded as 171.1 with a range from 163.8 to 177.8.
| che.di | hgt | |
|---|---|---|
| Min. :22.20 | Min. :147.2 | |
| 1st Qu.:25.65 | 1st Qu.:163.8 | |
| Median :27.80 | Median :170.3 | |
| Mean :27.97 | Mean :171.1 | |
| 3rd Qu.:29.95 | 3rd Qu.:177.8 | |
| Max. :35.60 | Max. :198.1 |
Glancing at the histogram, the distribution of both chest diameter and height are relatively normal.
ggplot(data,aes(che.di))+geom_histogram(bins=30)+ ylab('Frequency')+ggtitle('Histogram of Chest Diameter')
ggplot(data,aes(hgt))+geom_histogram(bins=30)+ ylab('Frequency')+ggtitle('Histogram of Height')ggplot(data,aes(y=che.di))+geom_boxplot(fill='red')+ggtitle('Summary of Chest Diameter')
ggplot(data,aes(y=hgt))+geom_boxplot(fill='yellow')+ggtitle('Summary of Height')\(H_0\): There is no correlation between chest diameter and height of a person.
\(H_a\): There is significant correlation between chest diameter and height of a person
Mathematically,
\(H_0: r = 0\)
\(H_a: r \ne0\)
library(Hmisc)
library(psychometric)
corr<-as.matrix(dplyr::select(data,che.di,hgt)) #Create a matrix of the variables to be correlated
rcorr(corr, type = "pearson")## che.di hgt
## che.di 1.00 0.63
## hgt 0.63 1.00
##
## n= 507
##
##
## P
## che.di hgt
## che.di 0
## hgt 0
## [1] 0.4222205 0.7707495
A Pearson’s correlation was calculated to measure the strength of the linear relationship between chest diameter and height. The positive correlation was statistically significant, r=.63, p<.001, 95% CI [0.422, .770]
\(H_0\): The data do not fit the linear regression model
\(H_a\): The data fit the linear regression model
Mathematically,
\(H_0: \alpha = 0\)
\(H_a: \alpha \ne0\)
##
## Call:
## lm(formula = che.di ~ hgt, data = data)
##
## Residuals:
## Min 1Q Median 3Q Max
## -6.3102 -1.4326 -0.0696 1.4168 6.8929
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -3.2947 1.7319 -1.902 0.0577 .
## hgt 0.1827 0.0101 18.082 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 2.138 on 505 degrees of freedom
## Multiple R-squared: 0.393, Adjusted R-squared: 0.3918
## F-statistic: 327 on 1 and 505 DF, p-value: < 2.2e-16
## 2.5 % 97.5 %
## (Intercept) -6.6972252 0.1079121
## hgt 0.1628512 0.2025541