Introduction

This is the R code and output used in the study to establish the relationship between height and weight.

ANZDATA <- read.csv("C:/Users/HP/Desktop/ANZDATA.csv")
#Summary statistics
summary(ANZDATA$height)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##    67.5   160.0   170.0   167.8   177.0   196.0
summary(ANZDATA$weight)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##    9.00   60.00   75.00   75.16   90.00  150.00
##Histograms for the variables
hist(ANZDATA$height, main="Distribution of Height in the Data", col="red")

hist(ANZDATA$weight, main="Distribution of Weight in the Data", col="green")

#Scatterplot
plot(ANZDATA$height,ANZDATA$weight,main="Relationship between Height and Weight",xlab="Height",ylab="Weight")

#Linear model
plot(ANZDATA$height,ANZDATA$weight,main="Relationship between Height and Weight",xlab="Height",ylab="Weight")
abline(lm(ANZDATA$weight~ANZDATA$height),col="red")

#Correlation Analysis
cor.test(ANZDATA$height,ANZDATA$weight,method="pearson")
## 
##  Pearson's product-moment correlation
## 
## data:  ANZDATA$height and ANZDATA$weight
## t = 15.067, df = 239, p-value < 2.2e-16
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.6268705 0.7575052
## sample estimates:
##       cor 
## 0.6979486