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?

##ANSWER (a): The average height of active individuals is 171.1 cm. The median is 170.3cm.

summary(bdims$hgt)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   147.2   163.8   170.3   171.1   177.8   198.1
  1. What is the point estimate for the standard deviation of the heights of active individuals? What about the IQR?

##ANSWER (b): The standard deviation of heights of active individuals is 9.41cm and the standard deviation is 14cm.

sd(bdims$hgt)
## [1] 9.407205
IQR(bdims$hgt)
## [1] 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.

##ANSWER (c): A 180cm person is not considered unusually tall as he falls within 1 standard deviation of the mean. Similarly, a person 155cm tall is not considered unusually short as he falls within 2 standard deviations of the mean. We could also calculate z-scores of the two heights 180cm and 155cm and check if the z-scores fall within 1, 2 or 3 standard deviations of the mean which in this case they are.

onesdupper <- 171.1 + 9.407205; onesdupper
## [1] 180.5072
onesdlower <- 171.1 - 9.407205; onesdlower
## [1] 161.6928
twosdupper <- 171.1 + 2 * 9.407205; twosdupper
## [1] 189.9144
twosdlower <- 171.1 - 2 * 9.407205; twosdlower
## [1] 152.2856
threesdupper <- 171.1 + 3 * 9.407205; threesdupper
## [1] 199.3216
threesdlower <- 171.1 - 3 * 9.407205; threesdlower
## [1] 142.8784
zscore180 <- (180 - 171.1) / 14; zscore180
## [1] 0.6357143
zscore155 <- (155 - 171.1) / 14; zscore155
## [1] -1.15
  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.

##ANSWER (d): No, each different random sample will have a mean and standard deviation that is similar but not identical to the previous one, as different observations will be included in each.

  1. 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.

##ANSWER (e): Standard error is used to quantify the variability of a simple random sample. The standard error in this case is 0.4177.

stderr <- sd(bdims$hgt) / sqrt(507); stderr
## [1] 0.4177887

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. We are 95% confident that the average spending of these 436 American adults is between $80.31 and $89.11.

##ANSWER (a): False, we are 95% confident that the average spending of all Americans is between $80.31 and $89.11.

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

##ANSWER (b): False, the sample mean needs to be normally distributed not the sample itself. Also, the observations are independent and the sample size is 30 or more. Hence, per the central limit theorem, the sample mean can be approximated by the normal model.

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

##ANSWER: False, we are 95% confident that the true population mean will lie between $80.31 and $89.11 (the confidence interval). Another interpretation is that 95% of the random samples will produce confidence intervals that contain the true population mean.

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

##ANSWER (d): True, as explained above.

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

##ANSWER (e): True, the wider the confidence interval, the smaller the rate of Type I errors at the cost of higher Type II errors.

  1. 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.

##ANSWER (f): False, if MOE = sd/(sqrt(n)) * z-score, then 1/3 * MOE = 1/3 * sd/(sqrt(n)) * z-score. Hence, n is 9 times bigger.

  1. The margin of error is 4.4.

##ANSWER (g): This is true, see below calculation.

sd(tgSpending$spending)
## [1] 46.92851
MOE <- 1.96 * 46.92851 / sqrt(436); MOE
## [1] 4.405037

Gifted children, Part I. Researchers investigating characteristics of gifted children collected 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 distribution 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?

##ANSWER (a): The observations are independent since 36 observations constitute less than 10% of the overall population of school children in the city (we are assuming there are no siblings in the dataset). Also the sample is random and since the sample size is > 30, moderate skew is not problematic and we can assume the underlying population follows a near normal distribution. Hence, the conditions for inference are satisfied.

  1. 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.

##ANSWER (b): The two hypothesis statements are - In statement terms, the average age at which gifted children first count to 10 successfully is 32 months. The alternative hypothesis statement is that the average age at which gifted children first count to 10 successfully is < 32 months.

##Hnull: H0: Mean = 32, HA: Mean < 32.

##This is a one-tailed hypothesis test where the population mean is 32 and the sample mean is the mean of the 36 observations calculated as 30.69. The z-score is -1.8216 (see calculation below). We look up the p-value in the normal probability table and find it to be 0.0359. p-value is < 0.1 (the significance level) so we reject the null hypothesis.

samp <- mean(gifted$count); samp
## [1] 30.69444
sd(gifted$count)
## [1] 4.314887
se <- sd(gifted$count)/6; se
## [1] 0.7191479
zscore <- (samp - 32) / se; zscore
## [1] -1.81542
  1. Interpret the p-value in context of the hypothesis test and the data.

##The p-value is the probability of observing a value equal to 30.69 or lower in a sample of 36 children, provided the null hypothesis is true.

  1. Calculate a 90% confidence interval for the average age at which gifted children first count to 10 successfully.

##The confidence interval is (29.50785, 31.88104), see calculation below.

lower <- samp - 1.65 * se; lower
## [1] 29.50785
upper <- samp + 1.65 * se; upper
## [1] 31.88104
  1. Do your results from the hypothesis test and the confidence interval agree? Explain.

## The results of the confidence interval and the hypothesis test agree as we rejected the null hypothesis that the average age at which giften children first count to 10 is 32. The age 32 lies outside the confidence interval (29.50785, 31.88104). However, we need to be careful as the population mean lies just outside the boundary of the confidence interval.

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.

##The null hypothesis is that the average IQ of mothers of gifted children is the same as the average IQ for the population at large. The alternative hypothesis in statement terms is that the average IQ of mothers of gifted children is not the same as the average IQ for the population at large. This is a two-tailed hypothesis test.

##H0: Mean = 100; HA: Mean != 100

##This is a two-tailed hypothesis test where the population mean is 100 and the sample mean is the mean of the 36 observations calculated as 118.1667. The z-score is 16.75649 (see calculation below). We look up the p-value in the normal probability table and find it to be (1 - 0.9998). p-value is very small and < 0.1 (the significance level) so we reject the null hypothesis.

samp1 <- mean(gifted$motheriq); samp1
## [1] 118.1667
sd(gifted$motheriq)
## [1] 6.504943
se <- sd(gifted$motheriq)/6; se
## [1] 1.084157
zscore1 <- (samp1 - 100) / se; zscore1
## [1] 16.75649
  1. Calculate a 90% confidence interval for the average IQ of mothers of gifted children.

##The 90% confidence interval is (116.3778, 119.9555).

lower1 <- samp1 - 1.65 * se; lower1
## [1] 116.3778
upper1 <- samp1 + 1.65 * se; upper1
## [1] 119.9555
  1. Do your results from the hypothesis test and the confidence interval agree? Explain.

## The results of the confidence interval and the hypothesis test agree as we rejected the null hypothesis that the average IQ of mothers of gifted children is 100. The population mean 100 lies outside the confidence interval (116.3778, 119.9555).

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 is the distribution of sample means of random samples. As the sample size increases, the shape should tend to symmetric, the center should tend to 0 and the spread should narrow.


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.

  1. What is the probability that a randomly chosen light bulb lasts more than 10,500 hours?

##The z-score can be calculated as (10,500 - 9,000) / 1,000 = 1.5. Looking up the z-score in the normal probability table, we have 0.9332 which is the percentage of the area under the curve to the left of Z. Since, we want to find the probability greater than Z, we subtract from 1 since the area under the normal curve is 1. We get = 1 - 0.9332 = 0.0668, hence 6.68% is the probability that a randomly chosen light bulb lasts more than 10,500 hours.

DATA606::normalPlot(mean = 0, sd = 1, bounds=c(1.5, 4), tails = FALSE)

  1. Describe the distribution of the mean lifespan of 15 light bulbs.

##Nearly normal with mean 9,000 and sd of 1,000 hours. SE = 1000 / sqt(15) = 258.19.

se <- 1000 / sqrt (15); se
## [1] 258.1989
  1. What is the probability that the mean lifespan of 15 randomly chosen light bulbs is more than 10,500 hours?

##Calculate the z-score with population mean of 9,000, sample mean of 10,500 and a sample size of 15. Since the z-score is > 3.5, the probability is >= 0.9998. Hence, 1 - p = (1 - 0.9998) = 0.0002 ~= 0. Hence, the probability that the mean lifespan of 15 randomly chosen lightbulbs is more than 10,500 hours is 0%.

zscore2 <- (10500 - 9000) / se; zscore2
## [1] 5.809475
  1. Sketch the two distributions (population and sampling) on the same scale.
par(mfrow = c(2, 1))
DATA606::normalPlot(mean = 9000, sd = 1000, tails = FALSE)
DATA606::normalPlot(mean = 9000, sd = 258.1989, tails = FALSE)

  1. Could you estimate the probabilities from parts (a) and (c) if the lifespans of light bulbs had a skewed distribution?

##No, because although we can calculate z-scores, we can only use normal probability tables to derive percentages only for normal distributions, not for skewed distributions.

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.

##p-value will decrease as sample size increases.