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.
##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
##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
##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
##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.
##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.
##ANSWER (a): False, we are 95% confident that the average spending of all Americans is between $80.31 and $89.11.
##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.
##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.
##ANSWER (d): True, as explained above.
##ANSWER (e): True, the wider the confidence interval, the smaller the rate of Type I errors at the cost of higher Type II errors.
##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.
##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.
##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.
##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
##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.
##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
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.
##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
##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
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.
##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)
##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
##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
par(mfrow = c(2, 1))
DATA606::normalPlot(mean = 9000, sd = 1000, tails = FALSE)
DATA606::normalPlot(mean = 9000, sd = 258.1989, tails = FALSE)
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.