{#The Normal Distribution:}

#The Data:

head(bdims) mdims <- subset(bdims, sex == 1) fdims <- subset(bdims, sex == 0)

##Exercise 1

men = subset(bdims,bdims\(sex == 1) women = subset(bdims,bdims\)sex == 0)

hist(women\(hgt, breaks = 20, main = "Women's Height") hist(men\)hgt, breaks = 20, main= “Men’s Height”)

Both are similar in that they are both normal distrubtions; however, the men’s distribution is slightly bigger.

#The Normal Distribution fhgtmean <- mean(fdims\(hgt) fhgtsd <- sd(fdims\)hgt)

hist(fdims$hgt, probability = TRUE) x <- 140:190 y <- dnorm(x = x, mean = fhgtmean, sd = fhgtsd) lines(x = x, y = y, col = “blue”)

##Exercise 2

The plot does seem like a normal distribution but the information is not enough to reveal if that is true—QQ plot is needed.

##Evaluating the Normal Distribution qqnorm(fdims\(hgt) qqline(fdims\)hgt) sim_norm <- rnorm(n = length(fdims$hgt), mean = fhgtmean, sd = fhgtsd)

##Exercise 3

sim_norm = rnorm(n = length(women$hgt), mean = fhgtmean, sd = fhgstd) qqnorm(sim_norm) qqline(sim_norm)

qqnormsim(women$hgt)

Most of the points fall on the line and the ones that dont are on the end of the line.

##Exercise 4

The results are significantly similar.

##Exercise 5

qqnormsim(women$wgt) The data seems skewed because of the curves present in the plots.

#Normal Probablities 1 - pnorm(q = 182, mean = fhgtmean, sd = fhgtsd) sum(fdims\(hgt > 182) / length(fdims\)hgt)

##Exercise 6

1 - pnorm(q = 182, mean = fhgtmean, sd = fhgtsd) #[1] -2

sum(fdims\(hgt > 182) / length(fdims\)hgt) [1] 0.003846154

Height had a closer agreement.

#On Your OWn

##1 #Pelvic Diameter qqnorm(women\(bii.di) qqline(women\)bii.di) #Elbow Diameter qqnorm(women\(elb.di) qqline(women\)elb.di) #General age qqnorm(bdims\(age) qqline(bdims\)age) #Chest Depth qqnorm(women\(che.de) qqline(women\)che.de)

##2 I think this is the case because the variables for elbow and pelvic diameters may not have been recorded as integers. The possibility of step wise patterns are more common in discrete data.

##3 qqnorm(women\(kne.di) qqline(women\)kne.di) hist(women$kne.di, breaks = 20)

The vairable is skewed to the right.