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:
1. The point estimate for the mean height of active individuals is 171.1.
2. The median is 170.3
summary(bdims$hgt)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 147.2 163.8 170.3 171.1 177.8 198.1
Answer:
1. The point estimate for the standard deviation of the heights of active individuals is 9.409205.
2. The IQR is 14.
sd(bdims$hgt)
## [1] 9.407205
IQR(bdims$hgt)
## [1] 14
Answer:
1. Assuming normal distribution, the critical value of 180cm is 0.94, which means this height is 0.94 standard deviation above mean. A person who is 180cm tall is within 95% confidence interval (critical value 0.94 < 1.96), therefore he / she is fairly tall.
2. The critical value of 155 cm is -1.72, which means this height is 1.72 standard deviation below mean. A person who is 155cm is still within 95% confidence interval (critical value -1.72 > -1.96), therefore he / she is still not unusually short.
hgt_mean <- mean(bdims$hgt)
hgt_sd <- sd(bdims$hgt)
(180 - hgt_mean)/hgt_sd
## [1] 0.9414287
(155 - hgt_mean)/hgt_sd
## [1] -1.716109
qnorm((1+0.95)/2)
## [1] 1.959964
Answer:
1. I will expect the mean and the standard deviation of the new sample to be close to the ones given above.
2. Because both samples are drawn from the same population.
3. However I don't expect the number to be exactly the same as the given ones because samples are raondomly choosen and won't likely to be identical.
Answer:
We use standard error to quantify the variability. The standard error of the original sample is around 0.418.
se <- hgt_sd/sqrt(nrow(bdims))
se
## [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:
True. Given the 95% confidence interval based on this sample is ($80.31, $89.11), we are 95% confident that the true mean of spending is within the given interval.
Answer:
False. The distribution is slightly right-skewed but the sample size is 436, which is fairly large, we consider the distribution of this sample is nearly normal.
Answer:
False. The true statement is 95% of random samples have a true mean between $80.31 and $89.11.
Answer:
True. The average spending of all American adults is the true mean of the population. This statement is true according to (a).
Answer:
True. The smaller the percentage of confidence interval, the narrower the range is.
Answer:
False. By using the standard error formula, $SE = \frac{\sigma}{\sqrt{n}}$, in order to have a new SE to a third of what is now, we would need to use a sample 3^2 = 9 times larger.
Anwer:
True. The margin of error at 95% confidence interval = 4.405038.
n <- 436
SE <- sd(tgSpending$spending) / sqrt(n)
1.96 * SE
## [1] 4.405038
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.
Answer:
Yes, the observations are independent of each other, the sample size is fairly large, and the distribution is nearly normal.
summary(gifted$count)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 21.00 28.00 31.00 30.69 34.25 39.00
library(moments)
skewness(gifted$count)
## [1] -0.1971696
Answer:
1. Null Hypothesis H0: $\mu$ = 32 months
Alternative Hypothesis H1: $\mu$ < 32 months
2. As the p-value we got is lower than the significance level 0.1, we reject the null hypothesis.
se <- sd(gifted$count)/sqrt(nrow(gifted))
mean <- mean(gifted$count)
(mean-32)/se
## [1] -1.81542
pnorm(q=mean, mean=32, sd=se)
## [1] 0.03472969
Answer:
1. In terms of the hypothesis test and the data in (b), P-value 0.035 means that there expected to be 3.5% chance that the sample mean (30.69) is 1.82 standard deviation less than the true mean (32).
Answer:
1. A 90% confidence interval is (29.51155, 31.87734)
z95 <- qnorm((1+0.9)/2)
ci90 <- c(mean - z95*se, mean + z95*se)
ci90
## [1] 29.51155 31.87734
Answer:
1. The result is consistent with the hypothesis test because the true mean 32 greater than ther upper limit of the 90% confidence interval. It is more than 90% unlikely that the true mean can be estimated in our dataset.
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.
Answer:
1. Null Hypothesis H0: $\mu$ = 100
Alternative Hypothesis H1: $\mu$ <> 100
2. As the p-value we got is 0, lower than the significance level 0.1, we reject the null hypothesis.
se <- sd(gifted$motheriq)/sqrt(nrow(gifted))
mean <- mean(gifted$motheriq)
1-pnorm(mean, 100,se)
## [1] 0
Answer:
1. A 90% confidence interval is (116.3834, 119.9499)
ci90 <- c(mean - z95*se, mean + z95*se)
ci90
## [1] 116.3834 119.9499
Answer:
1. Yes. The result is consistent with the hypothesis test because the true mean 100 less than ther lower limit of the 90% confidence interval. It is more than 90% unlikely that the true mean can be estimated in our dataset.
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.
Answer:
1. “sampling distribution” of the mean stands for recording n samples of the same sample size from the population and compute their sample means, and form a distribution using the sample means.
2. The distribution is a unimodal, nearly normal distibution.
3. As sample size increases, we expect
a. the shpe is remain a nearly normal bell shape,
b. the center gets more and more close to the true mean, and the frequency at the peak gets larger,
c. the spread of the sampling distribution gets narrower.
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.
Answer:
1. The probability that a randomly chosen light bulb lasts more than 10,500 hours in 6.68%.
mean <- 9000
sd <- 1000
pnorm(10500,mean,sd, lower.tail = FALSE)
## [1] 0.0668072
Answer:
1. The distribution of the mean life span of 15 light bulbs is a normal distribution with mean 9000 and standard error 258.1989.
se = sd/sqrt(15)
se
## [1] 258.1989
Answer:
1. The probability that the mean lifespan of 15 randomly chosen light bulbs is more that 10,500 hours is nearly 0.
pnorm(10500, mean, se, lower.tail = FALSE)
## [1] 3.133452e-09
uprange<-qnorm(0.001, mean, sd, lower.tail = FALSE)
lrrange<-qnorm(0.001, mean, sd)
x <- lrrange:uprange
par(mfrow = c(2,1))
plot(x, dnorm(x, mean, sd), type = "l", col = "deeppink3", ylim = c(0,0.002), main = "Population")
plot(x, dnorm(x, mean, se), type = "l", col = "deeppink3", ylim = c(0,0.002), main = "Sample")
Answer:
1. We cannot estimate the probabilities using mean and standard deviation if the distribution is skewed.
2. In the case that the distribution of skewed, we need to build other models to estimate / predict the probabilities.
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.
As the standard error = sd/sqrt(n), se decreases as sample size n increases. When se decreases, the absolute value of Z-score increases. Z-score the scalar of standard deviation away from mean. As abolute value of Z-score increases, in hypothesis test we expect the p-value to descrease.