Heights of adults. (7.7, p. 260) Researchers studying anthropometry collected body girth measurements and skeletal diameter measurements, as well as age, weight, height and gender, for 507 physically active individuals. The histogram below shows the sample distribution of heights in centimeters.

  1. What is the point estimate for the average height of active individuals? What about the median?
hgt_mean <- mean(bdims$hgt)
hgt_median <- median(bdims$hgt)

paste0('The mean is ',round(hgt_mean,2),'. The median is ',round(hgt_median,2),collapse='')
## [1] "The mean is 171.14. The median is 170.3"
  1. What is the point estimate for the standard deviation of the heights of active individuals? What about the IQR?
hgt_sd <- sd(bdims$hgt)
hgt_iqr <- IQR(bdims$hgt)
paste0('The standard deviation is ',round(hgt_sd,2),'. The IQR is ',round(hgt_iqr,2),collapse='')
## [1] "The standard deviation is 9.41. The IQR is 14"
  1. Is a person who is 1m 80cm (180 cm) tall considered unusually tall? And is a person who is 1m 55cm (155cm) considered unusually short? Explain your reasoning.

    Since the shapiro test shows that the height variable is not normal I can not use a normal distribution to check where the values fall. From eyeballing the distribution I would say 180 is fairly normal, while 155 is on the unusually short side.

shapiro.test(bdims$hgt)
## 
##  Shapiro-Wilk normality test
## 
## data:  bdims$hgt
## W = 0.99233, p-value = 0.01045
  1. The researchers take another random sample of physically active individuals. Would you expect the mean and the standard deviation of this new sample to be the ones given above? Explain your reasoning.

    No the mean and standard deviation should not be the same since it is a random sample of the participants. However, most of the time it should be reflective of the mean and std, but sometimes it will not be inside the ball park.

  2. The sample means obtained are point estimates for the mean height of all active individuals, if the sample of individuals is equivalent to a simple random sample. What measure do we use to quantify the variability of such an estimate (Hint: recall that \(SD_x = \frac{\sigma}{\sqrt{n}}\))? Compute this quantity using the data from the original sample under the condition that the data are a simple random sample.
n=length(bdims$hgt)
sd_x <- hgt_sd/n^(1/2)
paste0('The standard error is ',round(sd_x,3))
## [1] "The standard error is 0.418"

Thanksgiving spending, Part I. The 2009 holiday retail season, which kicked off on November 27, 2009 (the day after Thanksgiving), had been marked by somewhat lower self-reported consumer spending than was seen during the comparable period in 2008. To get an estimate of consumer spending, 436 randomly sampled American adults were surveyed. Daily consumer spending for the six-day period after Thanksgiving, spanning the Black Friday weekend and Cyber Monday, averaged $84.71. A 95% confidence interval based on this sample is ($80.31, $89.11). Determine whether the following statements are true or false, and explain your reasoning.

## [1] 84.70677
## [1] 46.92851
  1. We are 95% confident that the average spending of these 436 American adults is between $80.31 and $89.11.

    False because we know the average spending is $84.70.

  2. This confidence interval is not valid since the distribution of spending in the sample is right skewed.

    False the confidence interval can still be valid even if the distribution is skewed.

  3. 95% of random samples have a sample mean between $80.31 and $89.11.

    False. The data being used is a sample and other samples will have different intervals.

  4. We are 95% confident that the average spending of all American adults is between $80.31 and $89.11.

    True. We know the average spending is between $80.31 and $89.11

  5. A 90% confidence interval would be narrower than the 95% confidence interval since we don’t need to be as sure about our estimate.

    True. A 90% confidence interval captures less of the possible values of the mean.

  6. In order to decrease the margin of error of a 95% confidence interval to a third of what it is now, we would need to use a sample 3 times larger.

    This is false. Part of the formula for getting the standard error is to take the square root of the sample size, so in order to get a sample three times larger you would have to square the 3. Which equals 9. The sample size would have to be 9 times larger.

  7. The margin of error is 4.4.

    margin of error equals z * sd/sqrt(n). Which would be 1.96 * 46.93/sqrt(436)=4.405. This is true.


Gifted children, Part I. Researchers investigating characteristics of gifted children col- lected data from schools in a large city on a random sample of thirty-six children who were identified as gifted children soon after they reached the age of four. The following histogram shows the dis- tribution of the ages (in months) at which these children first counted to 10 successfully. Also provided are some sample statistics.

  1. Are conditions for inference satisfied?

    The data seems to be random. While being skewed and bimodal the data seems to be normally distributed. Assuming that children were taken from a variety of different backgrounds then yes the data is independent.

  2. Suppose you read online that children first count to 10 successfully when they are 32 months old, on average. Perform a hypothesis test to evaluate if these data provide convincing evidence that the average age at which gifted children fist count to 10 successfully is less than the general average of 32 months. Use a significance level of 0.10.

\(H_O: \mu= 32 months\) \(H_1:\mu<32\) \(SE_\bar{x}=\frac{s}{\sqrt{n}} \Rightarrow \frac{4.31}{\sqrt{36}}=.718\) \(Z=\frac{\bar{x}-\mu}{SE_\bar{x}} \Rightarrow \frac{30.69-32}{.718}=-1.8245\)

## [1] "p-value = 0.034 < .1, hence, we reject the null hypothesis"
  1. Interpret the p-value in context of the hypothesis test and the data.

    Since \(H_1: \mu<32\), with a significance value of .1, the p-value represents the probability that \(\mu\) is less than the significance value. The lower the p-value the greater probability that the observed difference has statistical significance ./p>

  2. Calculate a 90% confidence interval for the average age at which gifted children first count to 10 successfully. confidence interval: \(lower bound =\mu-Z*SE\Rightarrow30.69-1.645*.718=29.51\) \(upper bound = \mu+Z*SE\Rightarrow30.69-1.645*.718=31.87\)
  3. Do your results from the hypothesis test and the confidence interval agree? Explain.

    Yes they agree since the upper bound value is 31.87. Which is less than 32, like the alternate hypothesis states.


Gifted children, Part II. Exercise above describes a study on gifted children. In this study, along with variables on the children, the researchers also collected data on the mother’s and father’s IQ of the 36 randomly sampled gifted children. The histogram below shows the distribution of mother’s IQ. Also provided are some sample statistics.

  1. Perform a hypothesis test to evaluate if these data provide convincing evidence that the average IQ of mothers of gifted children is different than the average IQ for the population at large, which is 100. Use a significance level of 0.10.
n <- 36 
min <- 101 
mean <- 118.2 
sd <- 6.5 
max <- 131 
se <-sd/n^(1/2)
z <- round(qnorm(.95),2)

prob<-pnorm(100,118.2,se)
paste0('p-value = ',round(prob,15),' < .1, hence, we reject the null hypothesis',collapse='')
## [1] "p-value = 0 < .1, hence, we reject the null hypothesis"
  1. Calculate a 90% confidence interval for the average IQ of mothers of gifted children.
lower <- round(mean-z*se,3)
upper <- round(mean+z*se,3)
confidence interval: \(lower bound =\mu-Z*SE\Rightarrow 118.2-1.64*1.0833333=116.423\) \(upper bound = \mu+Z*SE\Rightarrow 118.2-1.64*1.0833333=119.977\) (c) Do your results from the hypothesis test and the confidence interval agree? Explain.

Yes, because the mean IQ for mothers of gifted kids falls within the interval.


CLT. Define the term “sampling distribution” of the mean, and describe how the shape, center, and spread of the sampling distribution of the mean change as sample size increases.

The sampling distribution of the mean is when you take point estimates,such as mean, of samples that are all a fixed size. The center remains pretty much the same, while the shape normalizes and spread tends to narrow as the sample size increases.


CFLBs. A manufacturer of compact fluorescent light bulbs advertises that the distribution of the lifespans of these light bulbs is nearly normal with a mean of 9,000 hours and a standard deviation of 1,000 hours.

cflb_mean <- 9000
cflb_sd <-1000
cflb_x <- 10500
p <- round(pnorm(cflb_x,cflb_mean,cflb_sd,lower.tail = F),4)
  1. What is the probability that a randomly chosen light bulb lasts more than 10,500 hours?

    The probability that a randomly chosen light bulb lasts more than 10,500 hours is 6.68%

  2. Describe the distribution of the mean lifespan of 15 light bulbs. The distribution is roughly normal with a mean of 9000 and standard deviation of \(\frac{1000}{\sqrt{15}}\).
  3. What is the probability that the mean lifespan of 15 randomly chosen light bulbs is more than 10,500 hours?
cflb_se <- cflb_sd/15^.5
prob_c <- round(pnorm(cflb_x,cflb_mean,cflb_se,lower.tail = F),4)

The probability that 15 randomly chosen light bulbs lifespan is more than 10,500 hours is 0.

  1. Sketch the two distributions (population and sampling) on the same scale.
norm <- seq(cflb_mean - (4 * cflb_sd), cflb_mean + (4 * cflb_sd), length=25)
ran<- seq(cflb_mean - (4 * cflb_se), cflb_mean + (4 * cflb_se), length=25)
densnorm <- dnorm(norm, cflb_mean, cflb_sd)
rannorm <- dnorm(ran, cflb_mean, cflb_se)

plot(norm, densnorm, type="l",col="black",
  xlab="Lightbulb Population vs Sampling",
  ylim=c(0,0.002))
lines(ran, rannorm, col="yellow")
(e) Could you estimate the probabilities from parts (a) and (c) if the lifespans of light bulbs had a skewed distribution?

No because the sample size of c is not big enough to assume normality. C would have to be at least n=30.


Same observation, different sample size. Suppose you conduct a hypothesis test based on a sample where the sample size is n = 50, and arrive at a p-value of 0.08. You then refer back to your notes and discover that you made a careless mistake, the sample size should have been n = 500. Will your p-value increase, decrease, or stay the same? Explain.

By enlarging the n, which is the denominator of the standard error’s formula, it will decrease the standard error. This in turn will decrease the p-value. Since the sample size increased by a multiple of ten, I would imagine that the new p-value would be significantly smaller than .08

n=500
se <-sd/n^(1/2)
z <- round(qnorm(.95),2)

prob<-pnorm(100,118.2,se)
prob
## [1] 0