install.packages("Bolstad", repos = "http://cran.us.r-project.org")
## 
## The downloaded binary packages are in
##  /var/folders/lq/q4b5f6yj44l8z66cd61zxhm40000gn/T//Rtmp1lp9Xl/downloaded_packages
library(Bolstad)
## 
## Attaching package: 'Bolstad'
## The following objects are masked from 'package:stats':
## 
##     IQR, sd, var
head(bears)
##   ID Age Month Sex Head.L Head.W Neck.G Length Chest.G Weight Obs.No  Name
## 1 39  19     7   1   10.0    5.0   15.0   45.0      23     65      1 Allen
## 2 41  19     7   2   11.0    6.5   20.0   47.5      24     70      1 Berta
## 3 41  20     8   2   12.0    6.0   17.0   57.0      27     74      2 Berta
## 4 41  23    11   2   12.5    5.0   20.5   59.5      38    142      3 Berta
## 5 41  29     5   2   12.0    6.0   18.0   62.0      31    121      4 Berta
## 6 43  19     7   1   11.0    5.5   16.0   53.0      26     80      1 Clyde
biometric <- read.table(header=TRUE, file="a tiny biometric survey.txt")
head(biometric)
##   HEIGHT WRIST HANDSPAN FEMALE
## 1     66   6.0      8.0   TRUE
## 2     63   8.0      6.0   TRUE
## 3     68   6.0      7.7  FALSE
## 4     59   8.0      6.0   TRUE
## 5     63   6.5      7.5   TRUE
## 6     72   9.0     11.0  FALSE

Exercise 1

For the bears data, conduct an F test comparing the male vs. female variances of weight. With “raw” data, you can use the var.test() function to compare variances. Is this result consistent with the GMVH?

with(bears,
  var.test(Weight[Sex==1],Weight[Sex==2], alternative="greater")
)
## 
##  F test to compare two variances
## 
## data:  Weight[Sex == 1] and Weight[Sex == 2]
## F = 3.4439, num df = 98, denom df = 43, p-value = 9.13e-06
## alternative hypothesis: true ratio of variances is greater than 1
## 95 percent confidence interval:
##  2.195713      Inf
## sample estimates:
## ratio of variances 
##           3.443867

Exercise 1 Response

Exercise 2

For the biometric data, does HEIGHT for males (FEMALE==FALSE) have a greater variance than for females?

with(biometric, var.test(HEIGHT[FEMALE==FALSE],HEIGHT[FEMALE==TRUE], alternative="greater")
)
## 
##  F test to compare two variances
## 
## data:  HEIGHT[FEMALE == FALSE] and HEIGHT[FEMALE == TRUE]
## F = 0.083772, num df = 95, denom df = 142, p-value = 1
## alternative hypothesis: true ratio of variances is greater than 1
## 95 percent confidence interval:
##  0.06180264        Inf
## sample estimates:
## ratio of variances 
##         0.08377206

Exercise 2 Response

Exercise 3

For the biometric data, does WRIST circumference for males (FEMALE==FALSE) have a greater variance than for females?

with(biometric, var.test(WRIST[FEMALE==FALSE],WRIST[FEMALE==TRUE], alternative="greater")
)
## 
##  F test to compare two variances
## 
## data:  WRIST[FEMALE == FALSE] and WRIST[FEMALE == TRUE]
## F = 0.45291, num df = 95, denom df = 142, p-value = 1
## alternative hypothesis: true ratio of variances is greater than 1
## 95 percent confidence interval:
##  0.3341334       Inf
## sample estimates:
## ratio of variances 
##          0.4529102

Exercise 4

For the biometric data, does HANDSPAN for males (FEMALE==FALSE) have a greater variance than for females?

with(biometric, var.test(HANDSPAN[FEMALE==FALSE],HANDSPAN[FEMALE==TRUE], alternative="greater")
)
## 
##  F test to compare two variances
## 
## data:  HANDSPAN[FEMALE == FALSE] and HANDSPAN[FEMALE == TRUE]
## F = 1.1755, num df = 95, denom df = 142, p-value = 0.1902
## alternative hypothesis: true ratio of variances is greater than 1
## 95 percent confidence interval:
##  0.8671922       Inf
## sample estimates:
## ratio of variances 
##           1.175459

Exercise 4 Response

Exercise 5

What do you conclude about the Greater Male Variance Hypothesis?

Exercise 5 Response