Graded: 4.4, 4.14, 4.24, 4.26, 4.34, 4.40, 4.48

4.4 Heights of adults

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.

(a) What is the point estimate for the average height of active individuals? What about the median?

adult.mean <- 171.1
adult.median <- 170.3
paste0("Point estimate for the average height of active individuals: ", adult.mean)
## [1] "Point estimate for the average height of active individuals: 171.1"
paste0("Point estimate for the mean height of active individuals: ", adult.median)
## [1] "Point estimate for the mean height of active individuals: 170.3"

(b) What is the point estimate for the standard deviation of the heights of active individuals? What about the IQR?

adult.sd <- 9.4
adult.IQR <- 177.8 - 163.8 # Q3 - Q1
paste0("SD: ", adult.sd)
## [1] "SD: 9.4"
paste0("IQR: ", adult.IQR)
## [1] "IQR: 14"

(c) 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.

Z.adult <- (180 - adult.mean)/(adult.sd)
paste0("The Z score is: ", round(Z.adult, 2), ". This is less than 2, and considered not unusual.")
## [1] "The Z score is: 0.95. This is less than 2, and considered not unusual."
Z.adult2 <- (155 - adult.mean)/(adult.sd)
paste0("The Z score is: ", round(Z.adult2, 2), ". This is greater than -2, and considered not unusual.")
## [1] "The Z score is: -1.71. This is greater than -2, and considered not unusual."

The adult would be considered tall if the adult is greater than 2 standard deviations above the norm.Similarly, an adult would be considered unusually short if the Z value is less than -2. Both 180cm and 155cm are not unusual considering their Z scores are within 2 stardard deviations

(d) 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.

I do not expect the mean and standard deviation to be exactly the same. A random sample will included many but not all individuals that were not in the first sample, the second sample will have a different mean and standard deviation than the first sample. We can expect that the second mean and standard deviation will be close to the first.

(e) 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 SDx ?? = pn )? Compute this quantity using the data from the original sample under the condition that the data are a simple random sample.

SE <- adult.sd/sqrt(507)
paste0("Standard error: ", round(SE,2))
## [1] "Standard error: 0.42"

4.14 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 dollars. 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.

(a) We are 95% confident that the average spending of these 436 American adults is between $80.31 and $89.11.

False. We know 100% for certain that the average spending costs of these 436 American adults is between $80.31 and $89.11. The point estimate is always in the confidence interval.

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

False. The defination of the confidence interval is based on the sample mean being Normally Distributed, not the sample itself. Since these people were selected at random and the sample size is greater than 30, by the Central Limit Theorem, the sample mean is normally distributed and the confidence intervals are valid

(c) 95% of random samples have a sample mean between $80.31 and $89.11.

False. The confidence interval is not about a sample mean.

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

True. This is the definition of a 95% Confidence Interval.

(e) 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. The lower the confidence interval, the less wide the net in approximation.

(f) 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.

False. In the calculation of the standard error, we divide the standard deviation by the square root of the sample size. To cut the SE (or margin of error) to a third, we would need to sample 3^2 = 9 times the number of people in the initial sample.

(g) The margin of error is 4.4.

True. Margin of Error = Z * standard of error. If the 95% confidence intervals = 89.11 - 80.31 = 8.80 Divide this number (8.80) by two = 4.40 Therefore, the mean is 84.71 and the margin of error is 4.40.

4.24 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 dis- tribution of the ages (in months) at which these children first counted to 10 successfully. Also provided are some sample statistics.

(a) Are conditions for inference satisfied?

Yes, the children were randomly selected, independent of each other, and the sample size is greater than 30.

(b) 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.

Null hypothesis (H0) is that 32 months is average for an average developing child. Alternate hypothesis (H1) states that the average does NOT equal 32 months. This is a two-tailed T test, with the alpha value = 0.10

giftedchild.n <- 36
giftedchild.min <- 21
giftedchild.mean <- 30.69
giftedchild.sd <- 4.31
giftedchild.max <- 39
child.SOE <- 4.31/sqrt(giftedchild.n)
child.Z <- (giftedchild.mean - 32)/(child.SOE)
p.value <- pnorm(child.Z, mean = 0, sd = 1) * 2 # To make it two-tailed
paste0("The two tailed T test p-value is: ", round(p.value,3), ", which is < 0.10, therefore, we reject the null hypothesis.")
## [1] "The two tailed T test p-value is: 0.068, which is < 0.10, therefore, we reject the null hypothesis."

(c) Interpret the p-value in context of the hypothesis test and the data.

paste0("With the p value < 0.10, this suggests that the gifted children count to 10 on average statistically faster than the normal child.")
## [1] "With the p value < 0.10, this suggests that the gifted children count to 10 on average statistically faster than the normal child."

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

child.lowerCI90 <- giftedchild.mean - 1.29 * child.SOE
child.upperCI90 <- giftedchild.mean + 1.29 * child.SOE
paste0("The lower CI90 to upper CI90 ranges from: ", child.lowerCI90, " to ", child.upperCI90)
## [1] "The lower CI90 to upper CI90 ranges from: 29.76335 to 31.61665"

(e) Do your results from the hypothesis test and the confidence interval agree? Explain.

Yes, the hypothesis testing and confidence interval agree. Both support the alternative hypothesis in providing convincing evidence that the average age at which gifted children first count to 10 successfully can be less than the general average of 32 months

4.26 Gifted children, Part II.

Exercise 4.24 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.

(a) 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 (H0) is that the average of IQ mothers of gifted children = average IQ of the population at large. The alternate hypothesis (H1): average of IQ mothers of gifted children != average IQ of the population at large. We will use the two tailed p value test to determine if there is any statistical difference we do not have the information about the population at large, we will need to use the information i.e. standard deviation from the sample as assumptions when we calculate for the standard of error. This can occur because the histogram appears near normal distribution and the N size is greater than 30.

# Assign values from the histogram
n <- 36
child.gift.min <- 101
child.gift.mean <- 118.2
child.gift.sd <- 6.5
child.gift.max <- 131
child.gift.SOE <- (child.gift.sd)/sqrt(n)
child.gift.Z <- (child.gift.mean - 100)/(child.gift.SOE)
paste("The Z score is: ", child.gift.Z)
## [1] "The Z score is:  16.8"
child.gift.twotailP <- (1 - pnorm(child.gift.Z, mean = 0, sd = 1)) * 2
paste("The Two Tail P value is: ", child.gift.twotailP)
## [1] "The Two Tail P value is:  0"
# With a P value of close to zero.So, we can reject the null hypothesis and accept the alternate hypothesis.

(b) Calculate a 90% confidence interval for the average IQ of mothers of gifted children.

# To make a 90% confidence interval, looking at the Z table. Z should equal 1.29
CI.upper90 <- child.gift.mean + 1.29 * child.gift.SOE
CI.lower90 <- child.gift.mean - 1.29 * child.gift.SOE
paste("Upper 90% CI: ", CI.upper90)
## [1] "Upper 90% CI:  119.5975"
paste("Lower 90% CI: ", CI.lower90)
## [1] "Lower 90% CI:  116.8025"

(c) Do your results from the hypothesis test and the confidence interval agree? Explain.

They agree, and both support rejecting the null hypothesis. In the 2-sided hypothesis testing, the p-value returned is so small that it is too far less than the significance level of 0.10, while the confidence interval does not include the average IQ of 100 for the population.

4.34 Sampling distribution

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 distributions” is the distribution of sample means, which closely resembles the normal distribution. The normal model for the sample mean tends to be very good when the sample consists of at least 30 independent observations and the population data are not strongly skewed. The approximation can be poor if the sample size is small, but it improves with larger sample sizes

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

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

#Assign values
bulb.mean <- 9000
bulb.sd <- 1000
LastingLonger <- pnorm(10500, mean = bulb.mean, sd = bulb.sd, lower.tail = FALSE)
paste0("The probability that a randomly chose light bulb lasts more than 10,500 hours is: ", round(LastingLonger,2) * 100, "%.")
## [1] "The probability that a randomly chose light bulb lasts more than 10,500 hours is: 7%."

(b) Describe the distribution of the mean lifespan of 15 light bulbs.

Since the population has normal distribution, the sample also would approximates normal distributio

fifteen.bulbs <- rnorm(15, mean = bulb.mean, sd = bulb.sd)
par(mfrow = c(1,2))
hist(fifteen.bulbs)
qqnorm(fifteen.bulbs)
qqline(fifteen.bulbs)

mean(fifteen.bulbs)
## [1] 8568.61

(c) What is the probability that the mean lifespan of 15 randomly chosen light bulbs is more than 10,500 hours?

fifteen.bulbs.SOE <- bulb.sd/sqrt(15)
ans <- pnorm(10500, mean = bulb.mean, sd = fifteen.bulbs.SOE, lower.tail = FALSE) * 100
paste("The probability that the mean lifespan of 15 randomly chosen light bulbs is more than 10,500 hours is: ", round(ans,2), "%.")
## [1] "The probability that the mean lifespan of 15 randomly chosen light bulbs is more than 10,500 hours is:  0 %."

(d) Sketch the two distributions (population and sampling) on the same scale.

par(mfrow = c(2,1))
bulb.pop <- rnorm(10000, mean = bulb.mean, sd = bulb.sd)
hist(bulb.pop, xlim = c(4000,14000), prob = TRUE)
lines(density(bulb.pop, adjust = 2), lty = "dotted", col = "darkgreen", lwd = 2)
hist(fifteen.bulbs, xlim = c(4000,14000), prob = TRUE)
lines(density(fifteen.bulbs, adjust = 2), lty = "dotted", col = "blue", lwd = 2)

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

If you have a skewed distribution, you CANNOT estimate the probabilities as one of the assumptions.

4.48 Different sample size

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.

The p-value decreases. As the sample increases, the standard error decreases which affects the z-score positively. When the area under the curve increases for the z-score, it decreases the area under the tail of the distributions. Therefore, having a higher N (sample size) value will allow you to reject the null hypothesis in favor of the alternative hypothesis.