library(tidyverse)
library(openintro)
download.file("http://www.openintro.org/stat/data/bdims.RData", destfile = "bdims.RData")
load("bdims.RData")
head(bdims)
##   bia.di bii.di bit.di che.de che.di elb.di wri.di kne.di ank.di sho.gi che.gi
## 1   42.9   26.0   31.5   17.7   28.0   13.1   10.4   18.8   14.1  106.2   89.5
## 2   43.7   28.5   33.5   16.9   30.8   14.0   11.8   20.6   15.1  110.5   97.0
## 3   40.1   28.2   33.3   20.9   31.7   13.9   10.9   19.7   14.1  115.1   97.5
## 4   44.3   29.9   34.0   18.4   28.2   13.9   11.2   20.9   15.0  104.5   97.0
## 5   42.5   29.9   34.0   21.5   29.4   15.2   11.6   20.7   14.9  107.5   97.5
## 6   43.3   27.0   31.5   19.6   31.3   14.0   11.5   18.8   13.9  119.8   99.9
##   wai.gi nav.gi hip.gi thi.gi bic.gi for.gi kne.gi cal.gi ank.gi wri.gi age
## 1   71.5   74.5   93.5   51.5   32.5   26.0   34.5   36.5   23.5   16.5  21
## 2   79.0   86.5   94.8   51.5   34.4   28.0   36.5   37.5   24.5   17.0  23
## 3   83.2   82.9   95.0   57.3   33.4   28.8   37.0   37.3   21.9   16.9  28
## 4   77.8   78.8   94.0   53.0   31.0   26.2   37.0   34.8   23.0   16.6  23
## 5   80.0   82.5   98.5   55.4   32.0   28.4   37.7   38.6   24.4   18.0  22
## 6   82.5   80.1   95.3   57.5   33.0   28.0   36.6   36.1   23.5   16.9  21
##    wgt   hgt sex
## 1 65.6 174.0   1
## 2 71.8 175.3   1
## 3 80.7 193.5   1
## 4 72.6 186.5   1
## 5 78.8 187.2   1
## 6 74.8 181.5   1
mdims <- subset(bdims, sex == 1)
fdims <- subset(bdims, sex == 0)
par(mfrow=c(1,2))
hist(mdims$hgt, main="Men's Heights")
hist(fdims$hgt, main="Female's Height")

fhgtmean <- mean(fdims$hgt)
fhgtsd   <- sd(fdims$hgt)

Exercise 1, based on the above histograms I would say the men’s height has more of a bell shape to it. If you place the line of fit over both we will be able to see the shapes are different. The female’s heights have almost two other bars between 55-65 that almost is the same in frequency to the median.

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

After plotting the density histogram with the first command, we create the x- and y-coordinates for the normal curve. We chose the x range as 140 to 190 in order to span the entire range of fheight. To create y, we use dnorm to calculate the density of each of those x-values in a distribution that is normal with mean fhgtmean and standard deviation fhgtsd. The final command draws a curve on the existing plot (the density histogram) by connecting each of the points specified by x and y. The argument col simply sets the color for the line to be drawn. If we left it out, the line would be drawn in black.

The top of the curve is cut off because the limits of the x- and y-axes are set to best fit the histogram. To adjust the y-axis you can add a third argument to the histogram function: ylim = c(0, 0.06).

Exercise 2

Based on the

this plot, does it appear that the data follow a nearly normal distribution? I would say based on the shape that the ine makes on the density curve it is fairly bell sahped, so yes a normal disturbution.

qqnorm(fdims$hgt)
qqline(fdims$hgt)

sim_norm <- rnorm(n = length(fdims$hgt), mean = fhgtmean, sd = fhgtsd)

Exercise 3

Make a normal probability plot of sim_norm. Do all of the points fall on the line? How does this plot compare to the probability plot for the real data?

sim_norm
##   [1] 158.7914 169.0215 168.0944 166.4225 169.7809 157.9615 158.2957 161.6171
##   [9] 156.0479 161.5264 156.9531 159.0374 160.9454 166.8905 150.9974 169.7801
##  [17] 167.0681 166.4320 167.0274 154.9331 161.1223 170.3451 169.8079 163.1129
##  [25] 167.3305 173.5222 165.4698 156.5451 175.8205 168.8228 176.5729 169.7482
##  [33] 161.2417 163.4797 164.3098 163.5510 170.9158 171.6883 157.6012 173.3353
##  [41] 159.2577 163.7808 170.0684 150.1129 169.5609 166.0472 159.7425 153.2519
##  [49] 164.8637 169.6552 166.9494 166.9810 164.0681 158.8488 164.1392 156.5987
##  [57] 163.4373 167.6857 151.6358 162.7280 160.9831 149.0331 159.6914 170.5371
##  [65] 162.1066 164.6109 163.6873 161.9807 166.9492 172.4017 172.9220 163.8797
##  [73] 170.3929 171.2380 169.2138 168.3076 170.8668 164.2236 159.7776 162.7202
##  [81] 170.2227 166.0519 157.1445 174.2310 160.6918 161.7851 162.4352 169.5657
##  [89] 154.7216 174.3947 161.2748 167.7546 159.5143 157.4769 172.6606 162.9634
##  [97] 170.8135 163.5406 168.1814 158.8668 146.0179 171.9625 170.9004 159.1898
## [105] 167.4661 159.5354 167.4696 167.1445 162.4671 163.6724 174.0628 160.8683
## [113] 173.5234 164.3977 157.3257 155.0960 159.5298 185.3021 164.2536 160.7263
## [121] 158.8433 156.8624 167.0871 163.3886 160.2472 175.7169 180.4455 158.1231
## [129] 164.6712 164.8648 170.9524 154.3242 168.9322 151.5666 169.3097 153.5706
## [137] 169.2675 170.6115 163.3800 170.4619 173.8786 158.7289 170.6299 157.4444
## [145] 166.1248 164.6001 156.0798 159.3823 175.6813 164.0245 153.5385 170.2935
## [153] 158.2849 161.9860 166.7815 175.5064 171.2604 165.5476 163.5191 147.9050
## [161] 156.8366 160.2356 160.2863 171.2940 162.8340 163.3568 167.9975 152.2451
## [169] 161.0512 167.3587 169.7175 163.0600 162.8421 164.9431 158.4423 157.8213
## [177] 172.0123 160.0173 163.3356 158.9791 157.1441 164.1000 164.5822 163.0214
## [185] 166.5315 171.8411 180.2970 167.7520 164.9779 149.0603 158.8385 165.1311
## [193] 156.8365 161.6027 157.2477 161.6291 166.4709 156.6686 156.7614 164.2528
## [201] 173.4272 174.4368 165.4463 165.0834 162.9132 162.3402 165.5246 161.9121
## [209] 171.1551 166.7706 169.7961 157.6377 175.5711 161.0979 158.0405 160.5711
## [217] 160.6357 164.5200 149.0605 157.6436 156.0616 168.2088 165.4831 168.5588
## [225] 161.0033 165.1731 171.5741 168.5928 165.3564 159.2672 161.4156 159.1284
## [233] 159.7350 166.4631 166.2631 170.7464 160.1069 167.9273 158.6444 168.4458
## [241] 175.1844 160.2367 165.2297 157.6258 177.4616 172.5733 175.0316 161.1552
## [249] 161.1802 165.8177 159.9379 163.1568 156.6042 163.1528 166.2992 157.4054
## [257] 155.9774 154.5270 153.5470 169.3451
qqnorm(sim_norm)
qqline(sim_norm)

I woud say both qqnorm plots look similar. On both the points are fairly close to the line with barely no points deviating.

qqnormsim(fdims$hgt)

Exercise 4

Does the normal probability plot for fdims$hgt look similar to the plots created for the simulated data? That is, do plots provide evidence that the female heights are nearly normal?

###The female height plot does look similar to the other 9 pots.

Exercise 5

Using the same technique, determine whether or not female weights appear to come from a normal distribution.

hist(fdims$wgt, main="Female's Weight")

Just based off the histogram, Female’s weights seem to be a bit skewed to the right.

fwgtmean <- mean(fdims$wgt)
fwgtsd   <- sd(fdims$wgt)
hist(fdims$wgt, probability = TRUE)
x <- 35:95
y <- dnorm(x = x, mean = fwgtmean, sd = fwgtsd)
lines(x = x, y = y, col = "blue")

Now that the line is against the histogram, i would say it does look more bell shaped showing a normal disturbution.

qqnorm(fdims$wgt)
qqline(fdims$wgt)

Female weight and height is definetly not the same. Like I stated before I think the weight histogram shows some skewness and you can see that at the upper tail end, around 2-3 theorectical quantiles between 80-90 sample quantiles. the points do not touch the line and seem to curve a bit up away frpom the line.

1 - pnorm(q = 182, mean = fhgtmean, sd = fhgtsd)
## [1] 0.004434387
sum(fdims$hgt > 182) / length(fdims$hgt)
## [1] 0.003846154

Exercise 6

Write out two probability questions that you would like to answer; one regarding female heights and one regarding female weights. Calculate the those probabilities using both the theoretical normal distribution as well as the empirical distribution (four probabilities in all). Which variable, height or weight, had a closer agreement between the two methods?

What is the probality that a femae weighs more than 70 kg (154 ibs)?

So we have the mean,60.600, and the SD, 9.616, we can find the Z score of this.

1 - pnorm(q = 70, mean = fwgtmean, sd = fwgtsd)
## [1] 0.1641539

This Z score is way bigger that the one we got for femae heights. Showing the weight is more towards not normal. We can also find the empiral probality.

sum(fdims$wgt > 70) / length(fdims$wgt)
## [1] 0.1576923

The theorectical is stil cose to the Z score, around 0.1, showing yes the weight is not a normal disturbution.

On Your Own

hist(fdims$bii.di, main="Female's Pelvic Diameter")

qqnorm(fdims$bii.di)
qqline(fdims$bii.di)

The histogram for female pelvic diameter belongs to Q plot B

hist(fdims$elb.di, main="Female Elbow Diameter")

qqnorm(fdims$elb.di)
qqline(fdims$elb.di)

B. The histogram for Female Elbow Diatmer belongs to the Q plot letter C

hist(fdims$age, main="Female's Age")

qqnorm(fdims$age)
qqline(fdims$age)

C. The histogram for genral age belongs to the Q plot letter D

hist(fdims$che.de, main="Female Chest Depth")

qqnorm(fdims$che.de)
qqline(fdims$che.de)

D. The last histogram belongs to Q plot letter A

2. I think they are stepwise because of the outliers of the histogram they are based on.

3

hist(fdims$kne.di, main="Female Knees")

qqnorm(fdims$kne.di)
qqline(fdims$kne.di)

3. The plot is right skewed and the histogram proves that. On the Q plot you can see the points at the upper tail end start to not touch the line. Instead they hover above it.

LS0tDQp0aXRsZTogIkxhYiAyOiBOb3JtYWwgRGlzdHVyYnV0aW9uIg0KYXV0aG9yOiAiRWFybCBCIg0KZGF0ZTogImByIFN5cy5EYXRlKClgIg0Kb3V0cHV0OiBvcGVuaW50cm86OmxhYl9yZXBvcnQNCi0tLQ0KDQpgYGB7ciBsb2FkLXBhY2thZ2VzLCBtZXNzYWdlPUZBTFNFfQ0KbGlicmFyeSh0aWR5dmVyc2UpDQpsaWJyYXJ5KG9wZW5pbnRybykNCmBgYA0KDQpgYGB7cn0NCmRvd25sb2FkLmZpbGUoImh0dHA6Ly93d3cub3BlbmludHJvLm9yZy9zdGF0L2RhdGEvYmRpbXMuUkRhdGEiLCBkZXN0ZmlsZSA9ICJiZGltcy5SRGF0YSIpDQpsb2FkKCJiZGltcy5SRGF0YSIpDQpgYGANCg0KDQpgYGB7cn0NCmhlYWQoYmRpbXMpDQpgYGANCg0KYGBge3J9DQptZGltcyA8LSBzdWJzZXQoYmRpbXMsIHNleCA9PSAxKQ0KZmRpbXMgPC0gc3Vic2V0KGJkaW1zLCBzZXggPT0gMCkNCmBgYA0KDQpgYGB7cn0NCnBhcihtZnJvdz1jKDEsMikpDQpoaXN0KG1kaW1zJGhndCwgbWFpbj0iTWVuJ3MgSGVp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