(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.
summary(bdims$hgt)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 147.2 163.8 170.3 171.1 177.8 198.1
What is the point estimate for the average height of active individuals? What about the median?
Answer: The point estimate for the average height of active individuals is 171.1 and median is 170.3
# the point estimate for the standard deviation of the heights
SD_hgt <- round(sd(bdims$hgt),2)
SD_hgt
## [1] 9.41
Q1 <- 163.8
Q3 <- 177.8
# IQR = 3rd Qu. - 1st Qu.
IQR <- Q3-Q1
IQR
## [1] 14
What is the point estimate for the standard deviation of the heights of active individuals? What about the IQR?
Answer: The point estimate for the standard deviation of the heights is 9.41 and the IQR is 14
Z_180 <- (180-171.1)/9.41
Z_180
## [1] 0.9458023
Z_155 <- (155-171.1)/9.41
Z_155
## [1] -1.710946
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: In order for a person to be considered as unusually tall, that height should be greader than 2 standard deviation. Z>=2. For 180cm, z score is 0.9458023 which is less than 2 and it is not unusual. Also for 155cm short is not unusual as z score is less than 2, which is -1.710946.
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: I would not expect the same mean and standard deviation, buy may be very similar to the previous one. There are always expected variations between samples.
E <- SD_hgt/sqrt(507)
E
## [1] 0.4179128
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: 0.417
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.
We are 95% confident that the average spending of these 436 American adults is between $80.31 and $89.11.
Answer: False. The sample mean is alsways in the confident interval. And the confident interval estimates the parameter for the population not just for the sample size.
This confidence interval is not valid since the distribution of spending in the sample is right skewed.
Answer: False. As observations in this scenario are independent and the sample size (436) is sufficiently large, the distribution resembles a normal distribution even thogh it is right skewed based on the Central Limit theorm.Therefor the confidence interval is valid.
95% of random samples have a sample mean between $80.31 and $89.11.
Answer: False. Confidence interval is determined by the sample size and it can change according to it. Yes in this scenario, mean value lie between the confidence interval.
We are 95% confident that the average spending of all American adults is between $80.31 and $89.11.
Answer: True. Yes, this statement is ture as confidence interval estimates the parameter for the whole population.
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: True. In this case we are using a 90% lower confidence level that will slightly narrow the interval.
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.
$$SE = \frac{\sigma}{\sqrt(n)}$$
$$SE = \frac{\sigma}{3*\sqrt(n)}$$
$$SE = \frac{\sigma}{\sqrt(3^2*n)}$$
$$SE = \frac{\sigma}{\sqrt(9*n)}$$
Answer: False. Inorder to reduce the margin of error three times, we have to increase the sample size 9 times.
upper <- 89.11
lower <- 80.31
MOE <- (upper-lower)/2
MOE
## [1] 4.4
The margin of error is 4.4.
Answer: True. Based on the R calculations margin of error is 4.4.
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.
summary(gifted$count)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 21.00 28.00 31.00 30.69 34.25 39.00
sd(gifted$count)
## [1] 4.314887
Are conditions for inference satisfied?
Answer: As the data collected were from a large city we can assume that they were independent. Also the random sample is big enough based on the requirement that need to be a random sample (10% or less of the population). Graph has a normal distribution look without and skeweness at any end. Therefor, it does statisfy the conditions for inference.
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.
H0 : Mean = 32
HA : Mean > 32
mean<-30.69
sd<-4.31
n<-36
# calculate SE
SE<-sd/sqrt(n)
#calc z difference
zmeandiff<-(mean-32)/SE
#lower-tail hypothesis testing
pvalue <- pnorm(zmeandiff)
pvalue
## [1] 0.0341013
Interpret the p-value in context of the hypothesis test and the data.
Answer: small p-value in this case is less than 0.05 which indicates strong evidence against the null hypothesis. Therefor we can reject the null hypothesis.
Calculate a 90% confidence interval for the average age at which gifted children first count to 10 successfully.
# Confidence Interval
z <- abs(qnorm(.1))
lower <- mean - (z*SE)
upper <- mean + (z*SE)
lower
## [1] 29.76942
upper
## [1] 31.61058
Do your results from the hypothesis test and the confidence interval agree? Explain.
Yes it does. As we rejected the null hypothesis based on the small p-value that resulted in hypothesis test, we can assume the same thing as the mean of 32 months does not falls within the confidence interval.
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.
Perform a hypothesis test to evaluate if the se 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.
H0 : Mean = 100
HA : Mean > 100
mean<-118.2
sd<-6.5
n<-36
# calculate SE
SE<-sd/sqrt(n)
#calc z difference
z <-(mean-100)/SE
#lower-tail hypothesis testing
p <- 2*pnorm(z, 0, 1, lower.tail = FALSE)
p
## [1] 2.44044e-63
Answer: According to the hypothesis test the p value is very low compared to the significance level of 0.10. Therefor we can reject the null hypothesis.
Calculate a 90% confidence interval for the average IQ of mothers of gifted children.
z <- abs(qnorm(.1))
lower <- mean - (z*SE)
upper <- mean + (z*SE)
lower
## [1] 116.8117
upper
## [1] 119.5883
Do your results from the hypothesis test and the confidence interval agree? Explain.
Answer: They do agree. Since the population mean (100) does not falls within the confidence interval.
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: Sampling distribution acts as a frame of reference for statistical decision making. Random samples are rarely exactly represent the underlying population. Sampling distribution of the mean is the probablity distribution of means for all possible random sample of a given size of some population. Sample distribution of the mean approximates a normal distribution even when the parent population is non-normal. The larger the sample size, the closer the sampling distribution of the mean would be to a normal distribution. The Center will alsways stay in the mean.
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.
z <- (10500-9000)/1000
1-pnorm(z)
## [1] 0.0668072
normalPlot(bounds = c(z,Inf))
6.68% chance that a randomly chosen bulb lasts more than 10,500 hours.
Describe the distribution of the mean lifespan of 15 light bulbs.
bulb15 <- rnorm(15, mean = 9000, sd = 1000)
hist(bulb15, probability = TRUE)
summary(bulb15)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 7581 8178 9131 9032 9869 10314
Answer: Sample size is 15 which is small. Therefor the distribution is not normal. It is left skewed with a mean of 8930 and a median of 9123.
What is the probability that the mean lifespan of 15 randomly chosen light bulbs is more than 10,500 hours?
sd15 <- sd(bulb15)
n <- 15
x <- 10500
mu <- 9000
sd <- 1000
SE15 <- sd15/sqrt(n)
p15 <- round((1 - pnorm(x, mean = mu, sd = SE15)) * 100,4)
p15
## [1] 0
Answer: The probability that the mean lifespan of 15 randomly chosen light bulbs is more than 10,500 hours is approximately 0%.
Sketch the two distributions (population and sampling) on the same scale.
p <- rnorm(1000, 9000, 1000) # This popualtion size (1000) was chosen so you can see the sample
hist(p, col= 'blue' )
hist(bulb15, col= 'yellow', add=T)
box()
Answer: The population is in blue and the sample is in yellow, you can see the sample near the bottom.
Could you estimate the probabilities from parts (a) and (c) if the lifespans of light bulbs had a skewed distribution?
Answer: If there is a skewed distribution, it is difficult to estimate the probabilities as one of the assumptions in order to perform these calculations is that there must be a normal distributions.
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.
Answer: p-value is derived from the Z-score using SE instead of SD. Everything else being the same, as sample size increased, SE decreases and Z-score increases. A Z-score increases the probability decreases so p-value decreases