Homework 2

Course

STAT218

Due

January 16, 2025

Practice problems

  1. Vu and Harrington exercise 4.1. Additionally:

    1. Compute an interval estimate for the mean BGC of nests and interpret the interval in context.
    2. Supposing a sample of 30 nests returned exactly the same summary statistics, recompute your interval in (e). Is the margin of error smaller or larger?

Note: this problem can be done entirely by hand. Alternatively, if you wish to use R, you can input the given summary statistics directly – for example, bcg.mean <- 0.6052 – and perform the calculations as in the lab activity.

# input summary statistics directly for this problem

# part a: point estimate for population mean is sample mean
bgc.mean <- 0.6052

# part b: point estimate for population sd is sample sd
bgc.sd <- 0.0131

# part c: deviation of 0.63, relative to sd
(0.63 - bgc.mean)/bgc.sd
[1] 1.89313
# part d: standard error for estimate in (a)
bgc.se <- bgc.sd/sqrt(70)
bgc.se
[1] 0.001565749
# part e: interval for the population mean
bgc.mean + c(-2, 2)*bgc.se
[1] 0.6020685 0.6083315
# part f: repeat e, but suppose only 30 nests were measured
bgc.mean + c(-2, 2)*bgc.sd/sqrt(30)
[1] 0.6004166 0.6099834
  1. A value of 0.63 would be somewhat high, but not too extreme – the distance from the sample mean is 1.9 times the average distance among the observed values.
  2. The mean BCG of nests is estimated to be between 0.6021 and 0.6083 units.
  3. If the sample size had been 30, the interval estimate would be wider.
  1. The brfss dataset contains a measurement of body weight, weight, as well as a variable, wtdesire, that is the desired weight reported by respondents.

    1. Compute point estimates and standard errors for the actual and desired body weight of U.S. adults.
    2. Report your estimates in (a) following conventional style.
    3. Do your estimates suggest that the average U.S. adult would prefer to lose or gain weight?
    4. Compute an interval estimate for the mean difference between actual and desired weight. Interpret the interval in context.
# load dataset and inspect
load('data/brfss.RData')
head(brfss)
    genhlth exerany hlthplan smoke100 height weight wtdesire age gender
1 very good       1        1        1     75    265      225  45      m
2 excellent       1        1        0     72    150      150  24      m
3 excellent       1        1        1     69    137      150  47      m
4      good       1        1        1     66    159      125  26      f
5 very good       1        1        0     63    145      125  33      f
6 very good       1        1        1     64    125      120  28      f
## part a: point and interval estimates for...

# actual body weight
weight <- brfss$weight
weight.mean <- mean(weight)
weight.se <- sd(weight)/sqrt(length(weight))
weight.mean
[1] 173.3
weight.se
[1] 6.330372
# desired body weight
desweight <- brfss$wtdesire
desweight.mean <- mean(desweight)
desweight.se <- sd(desweight)/sqrt(length(desweight))
desweight.mean
[1] 155.0833
desweight.se
[1] 3.859634
## part d: interval estimate for mean difference
weight.diff <- brfss$weight - brfss$wtdesire
weight.diff.mean <- mean(weight.diff)
weight.diff.se <- sd(weight.diff)/sqrt(length(weight.diff))
weight.diff.mean + c(-2, 2)*weight.diff.se
[1]  9.577498 26.855835
  1. The mean actual weight of U.S. adults is estimated to be 173.3 lbs (SE 6.330); the mean desired weight of U.S. adults is estimated to be 155.08 lbs (SE 3.860).
  2. Estimates suggest the average U.S. adult wishes to lose weight; mean desired weight is estimated to be less than mean actual weight.
  3. It is estimated that the average U.S. adult wishes to lose between 9.58 and 26.86 lbs.