1. LON-CAPA Logo
  2. Help
  3. Log In
 

Browsing resource, all submissions are temporary.


Body Mass Index: Part 2

Last week, you looked at the students' weights and heights from a random sampling of the combined Stat 100 and Stat 200 survey data from Fall 2016 and calculated their BMIs. This time you will look at the BMI result more and will perform a hypothesis test on the possible gender difference in BMI.

Instead of sampling 200 students from the data as we did last time, we now sample 500 students in this problem because you will perform a hypothesis test. As you learn in Stat 200, larger sample size has a higher power of detecting an effect. Here are the random sample chosen by the computer. Copy and paste the following commands to your R and execute them.

weight <- c(130, 119, 175, 180, 142, 105, 160, 197, 155, 160, 265, 125, 125, 140, 125, 120, 145, 250, 105, 150, 126, 158, 125, 122, 170, 245, 126, 123, 153, 135, 150, 203, 115, 160, 115, 148, 132, 197, 110, 104, 88, 100, 119, 187, 215, 111, 186, 125, 140, 185, 130, 150, 205, 140, 150, 155, 120, 123, 145, 142, 87, 165, 159, 140, 150, 130, 120, 112, 140, 120, 92, 155, 300, 131, 187, 185, 84, 185, 140, 127, 135, 160, 175, 140, 100, 185, 160, 160, 125, 130, 137, 150, 140, 128, 108, 135, 155, 108, 149, 130, 185, 210, 140, 100, 120, 127, 219, 132, 80, 160, 150, 160, 185, 128, 128, 120, 160, 178, 140, 194, 160, 130, 140, 113, 125, 140, 112, 168, 140, 133, 185, 120, 114, 170, 135, 158, 140, 200, 115, 125, 184, 135, 142, 100, 100, 138, 143, 145, 140, 130, 140, 122, 137, 115, 190, 127, 166, 140, 125, 110, 113, 160, 160, 180, 110, 125, 135, 120, 105, 245, 185, 125, 125, 192, 130, 100, 155, 135, 129, 165, 300, 158, 134, 170, 123, 130, 144, 100, 110, 124, 180, 179, 135, 138, 140, 170, 120, 143, 265, 163, 130, 120, 126, 95, 153, 130, 175, 145, 135, 144, 120, 124, 146, 138, 175, 135, 135, 139, 137, 160, 117, 152, 148, 144, 135, 162, 128, 160, 132, 180, 100, 197, 138, 224, 186, 180, 140, 120, 128, 105, 103, 102, 157, 100, 180, 240, 113, 115, 160, 140, 160, 140, 118, 162, 130, 155, 200, 130, 112, 140, 120, 125, 150, 145, 114, 160, 100, 158, 120, 190, 140, 180, 171, 228, 120, 120, 134, 140, 130, 196, 111, 136, 120, 125, 150, 105, 120, 180, 198, 250, 163, 135, 120, 180, 127, 120, 135, 125, 146, 108, 171, 100, 167, 140, 165, 160, 250, 165, 170, 165, 204, 135, 265, 140, 110, 130, 131, 132, 155, 243, 180, 160, 115, 130, 86, 125, 109, 195, 151, 175, 140, 130, 165, 167, 122, 155, 149, 155, 145, 115, 180, 130, 120, 150, 195, 130, 150, 157, 153, 137, 145, 173, 143, 182, 140, 141, 130, 193, 175, 150, 163, 168, 128, 150, 215, 114, 130, 162, 137, 108, 135, 126, 120, 118, 136, 148, 167, 137, 150, 140, 102, 160, 90, 125, 110, 177, 140, 150, 132, 200, 132, 126, 146, 148, 140, 165, 132, 136, 137, 192, 143, 130, 133, 175, 230, 158, 107, 134, 155, 135, 117, 120, 116, 153, 177, 145, 122, 190, 119, 170, 130, 96, 158, 190, 127, 135, 110, 162, 162, 120, 125, 125, 190, 145, 128, 170, 155, 240, 174, 140, 175, 133, 163, 147, 220, 213, 130, 170, 255, 151, 110, 139, 104, 130, 200, 150, 130, 115, 133, 118, 200, 107, 166, 180, 137, 120, 190, 110, 167, 130, 252, 300, 132, 110, 140, 125, 115, 170, 195, 154, 140, 140, 160, 216, 110, 109, 125, 130, 180, 180, 138, 152, 145, 155, 160, 108, 205, 180, 157, 142)

height <- c(59, 64, 72, 65, 68, 63, 72, 73, 70, 70, 76, 64, 68, 70, 66, 64, 65, 71, 63, 69, 64, 72, 61, 67, 66, 64, 69, 63, 64, 64, 72, 70, 64, 69, 67, 69, 69, 71, 64, 64, 64, 62, 66, 72, 75, 62, 71, 65, 68, 72, 63, 67, 71, 65, 67, 64, 65, 62, 74, 70, 63, 75, 69, 67, 65, 65, 61, 62, 64, 63, 64, 68, 75, 63, 75, 64, 58, 68, 68, 66, 64, 71, 72, 68, 63, 75, 66, 68, 63, 65, 71, 70, 63, 64, 62, 64, 74, 60, 71, 69, 64, 67, 66, 60, 64, 63, 66, 67, 76, 67, 73, 66, 72, 66, 62, 62, 73, 72, 61, 72, 72, 70, 65, 64, 64, 71, 59, 71, 70, 62, 67, 66, 64, 75, 63, 67, 66, 68, 65, 65, 68, 62, 69, 67, 65, 63, 67, 71, 68, 67, 67, 64, 66, 66, 75, 63, 66, 63, 66, 65, 62, 70, 66, 72, 65, 68, 67, 60, 62, 72, 71, 64, 67, 73, 63, 66, 69, 68, 81, 69, 78, 67, 67, 64, 66, 67, 68, 65, 67, 68, 62, 70, 68, 69, 67, 72, 63, 63, 69, 68, 65, 65, 64, 62, 66, 62, 68, 62, 62, 70, 66, 63, 68, 68, 70, 67, 64, 69, 68, 64, 63, 66, 72, 66, 65, 63, 67, 70, 66, 73, 59, 76, 64, 68, 67, 70, 67, 65, 68, 63, 62, 60, 73, 62, 67, 73, 64, 64, 68, 72, 70, 66, 60, 73, 66, 70, 73, 66, 61, 69, 62, 64, 71, 61, 61, 66, 63, 71, 64, 70, 67, 74, 65, 74, 63, 60, 66, 72, 67, 72, 65, 64, 67, 64, 64, 60, 66, 67, 68, 78, 73, 65, 67, 63, 67, 66, 64, 65, 68, 61, 69, 60, 65, 71, 70, 69, 71, 70, 69, 70, 75, 67, 74, 73, 66, 65, 65, 69, 66, 72, 69, 74, 62, 60, 65, 63, 66, 67, 69, 74, 67, 67, 70, 70, 67, 74, 73, 65, 63, 63, 72, 61, 63, 63, 75, 64, 63, 70, 65, 68, 64, 71, 67, 73, 71, 63, 64, 73, 70, 72, 65, 72, 64, 77, 74, 63, 66, 69, 66, 62, 67, 65, 62, 67, 69, 72, 71, 68, 67, 66, 62, 59, 60, 63, 64, 67, 67, 66, 67, 82, 72, 67, 68, 70, 65, 71, 64, 66, 63, 72, 63, 72, 68, 75, 70, 72, 62, 72, 71, 65, 64, 62, 67, 67, 71, 70, 71, 65, 64, 61, 64, 63, 66, 66, 60, 65, 64, 69, 68, 67, 62, 66, 74, 72, 70, 69, 67, 68, 65, 63, 74, 62, 64, 70, 74, 66, 66, 67, 70, 73, 66, 69, 64, 62, 64, 63, 64, 69, 64, 65, 72, 61, 68, 75, 66, 64, 73, 64, 71, 72, 73, 74, 71, 72, 66, 65, 64, 66, 70, 72, 67, 68, 65, 62, 65, 63, 65, 64, 77, 63, 67, 65, 74, 69, 66, 63, 75, 70, 67, 67)

gender <- c("F", "F", "F", "F", "M", "F", "M", "M", "M", "M", "M", "F", "F", "M", "F", "F", "F", "M", "F", "M", "F", "M", "F", "F", "M", "F", "F", "F", "F", "F", "M", "F", "F", "M", "M", "M", "M", "M", "F", "F", "F", "M", "F", "M", "M", "F", "M", "F", "F", "M", "F", "F", "M", "F", "M", "F", "F", "F", "M", "M", "F", "M", "M", "M", "F", "F", "F", "F", "F", "F", "F", "M", "M", "F", "M", "F", "F", "M", "F", "F", "F", "M", "M", "F", "F", "M", "F", "F", "F", "M", "F", "M", "F", "F", "F", "F", "F", "F", "M", "F", "F", "F", "F", "F", "F", "F", "F", "M", "F", "F", "M", "F", "M", "F", "F", "F", "M", "M", "F", "M", "M", "M", "F", "F", "F", "M", "F", "M", "M", "F", "M", "F", "F", "M", "F", "F", "F", "M", "F", "F", "M", "F", "M", "F", "F", "F", "F", "M", "M", "F", "M", "F", "F", "F", "M", "F", "F", "F", "F", "F", "F", "F", "F", "M", "F", "M", "F", "F", "F", "M", "M", "F", "F", "M", "F", "F", "M", "F", "M", "F", "M", "M", "F", "F", "F", "F", "M", "F", "M", "F", "F", "F", "F", "M", "M", "M", "F", "F", "M", "M", "F", "F", "F", "F", "M", "F", "M", "F", "F", "M", "F", "F", "F", "M", "M", "F", "F", "F", "F", "F", "F", "F", "M", "M", "F", "F", "F", "M", "F", "M", "F", "M", "F", "M", "F", "M", "M", "F", "M", "F", "F", "F", "M", "F", "F", "M", "F", "F", "M", "F", "F", "F", "F", "M", "F", "M", "M", "F", "F", "M", "F", "F", "M", "F", "F", "F", "F", "M", "F", "M", "M", "M", "M", "M", "F", "F", "M", "M", "F", "M", "F", "F", "F", "M", "F", "F", "F", "M", "M", "M", "M", "F", "F", "F", "F", "M", "F", "F", "F", "F", "M", "F", "M", "M", "M", "M", "M", "M", "M", "M", "M", "M", "M", "M", "F", "F", "F", "M", "F", "M", "M", "M", "F", "F", "F", "F", "F", "F", "M", "M", "F", "F", "F", "M", "F", "M", "M", "F", "F", "F", "M", "F", "F", "F", "M", "F", "F", "F", "M", "F", "F", "M", "M", "M", "M", "F", "F", "M", "F", "F", "F", "M", "F", "M", "M", "F", "M", "M", "M", "F", "F", "F", "F", "F", "M", "M", "M", "F", "M", "M", "F", "F", "F", "F", "F", "F", "M", "F", "F", "M", "M", "F", "F", "M", "F", "M", "F", "M", "F", "M", "F", "M", "F", "M", "M", "M", "F", "M", "M", "F", "F", "F", "M", "F", "M", "F", "M", "F", "F", "F", "F", "M", "F", "M", "F", "F", "F", "M", "M", "F", "F", "F", "M", "M", "M", "F", "M", "F", "F", "F", "M", "F", "F", "F", "M", "M", "F", "F", "M", "M", "F", "M", "F", "F", "F", "F", "F", "M", "F", "F", "M", "F", "F", "M", "F", "F", "M", "F", "M", "M", "M", "M", "M", "F", "M", "F", "F", "F", "M", "M", "F", "F", "F", "F", "F", "F", "F", "F", "M", "F", "M", "M", "M", "F", "F", "F", "M", "F", "M", "M")

Recall that weight is measured in pounds and height is in inches. Calculate the BMI according to the formula BMI = 703×(Wlb/H2in) kg/m2 as in the previous problem.

People are classified as "underweight", "normal weight", "overweight" and "obese" if their BMI fall into the following ranges:

BMI < 18.5 kg/m2    underweight
18.5 kg/m2 ≤ BMI < 25 kg/m2    normal weight
25 kg/m2 ≤ BMI < 30 kg/m2    overweight
BMI ≥ 30 kg/m2    obese

a. Calculate the percentages of students in the sample who are underweight, normal weight, overweight and obese.
Consistency check: Make sure the percentages add up to 100%.
Sanity check: percentage in a category = (number of students in that category / total number × 100)% = (number of students in that category / 5)% since there are 500 students in the sample. Any integer divided by 5 can have at most 1 decimal point. So make sure all of your answers are numbers with no more than 1 decimal point.

Percentage of underweight students = %

Percentage of normal weight students = %

Percentage of overweight students = %

Percentage of obese students = %

 Tries 0/5

b. The gender variable contains the information of individual student's gender ("F" = female, "M" = male). Calculate the number of male and female students in the sample.
Consistency check: The two numbers should add up to 500, the total number of students in the sample.

Number of female students =

Number of male students =

 Tries 0/3

c. Calculate the mean and sample standard deviation of the BMI for the male and female students. Give your answers to 3 decimal places.

Female students: mean BMI = ,     sample sd of BMI = .

 Tries 0/3

Male students: mean BMI = ,     sample sd of BMI = .

 Tries 0/3

The average of BMI between male and female is not the same. To determine if the difference is statistically significant. We now perform a two-sample z-test. The test assumes the following null and alternative hypothesis:

H0: The mean BMI for the male and female students are the same. The observed difference is due to chance variation.
Ha: The mean BMI for the male and female students are not the same.

The two-sample z test computes the z-score assuming H0:

z = (observed difference) / SEdifference.

Here observed difference = mean of BMI for male students - mean of BMI for female students = BMIM - BMIF,

SEdifference = √SE2M + SE2F, where SEM is the standard error for BMIM and SEF is the standard error for BMIF. Since the sample is random, we have

SE2M = σ2M / nM and SE2F = σ2F / nF. Here nM is the number of male students and nF is the number of female students in the sample. Unlike many problems you've encountered in Stat 200, nM and nF are not the same in this problem. σ2M is the population variance of the BMI for male students, and σ2F is the population variance of the BMI for female students. We don't know the population variances, but we can use the sample variances as substitutes since we have a decent sample size.

To summarize, the test statistics z can be calculated using the formula

z = (BMIM - BMIF) / SEdifference   ,

SEdifference = √s2M/nM + s2F/nF  .

Here BMIM, BMIF, sM and sF are the means and sample standard deviations calculated in part (c), nM and nF are the number of male and female students calculated in part (b).

d. Enter the value of z to 2 decimal places.
Note: Be careful about the rounding issue. It's generally a good idea to store all of your calculations in variables and use the variables for further calculations. This way you are sure that your values are accurate within the machine roundoff error, which is about 16 significant figures for real numbers.

z =

 Tries 0/3

e. Calculate the p-value associated with z. Adopting the null cut-off α = 5%, what do you conclude?


 Tries 0/1

When the full data are used to do the analysis, the gender difference in BMI is highly significant (z = 5.68, p-value = 1.3×10-8). However, you are not using the full data in this problem. A simulation was performed where 500 samples were random drawn from the data and then a z-test was performed. The experiment was repeated 10,000 times to see how many times the z-test failed to reject the null. The result is that for a sample of 500, the type II error rate is about 5%. This means that there is 5% chance that you will fail to reject the null in your test. The type II error rate is much higher for a sample size of 200. That's why we don't use 200 in this problem.

The gender difference in BMI is also observed in a larger population, and the difference in general changes with ages (see, e.g., http://halls.md/bmi-difference-men-women/).