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.

  1. What is the point estimate for the average height of active individuals? What about the median? (See the next page for parts (b)-(e).)

The point estimate for the average height of active individuals is 171.1. The point estimate for the median height of active individuals is 170.3.

  1. What is the point estimate for the standard deviation of the heights of active individuals? What about the IQR?

The point estimate for the standard deviation height of active individuals is 9.4.

177.8-163
## [1] 14.8

The point estimate for the IQR height of active individuals is 14.8

  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.

In order to answer this question let’s calculate Z-scores.

Z_tall <- (180-171.1)/9.4
Z_tall
## [1] 0.9468085
pnorm(Z_tall)
## [1] 0.8281318
# or
pnorm(q = 180, mean = 171.1, sd = 9.4)
## [1] 0.8281318

Let’s assume that the sample is normally distributed. Since the person is 1m 80cm (180 cm) tall is within 0.94 standard deviation of the mean he is not “unusually” tall. He is taller than 82.81% of the people in a sample.

Z_short <- (155-171.1)/9.4
Z_short
## [1] -1.712766
pnorm(Z_short)
## [1] 0.0433778
# or 
pnorm(q = 155, mean = 171.1, sd = 9.4)
## [1] 0.0433778

Person who is 1m 55cm (155cm) tall can be considered “unusually” short since his height is -1.71 standard deviations from the mean. He is taller than 4.34% people in the sample.

  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.

I expect that the sample the mean and the standard deviation of this new sample will be close to the sample above but they will not be exactly the same.

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

We use standard error to estimate the mean height of all active individuals.

9.4/sqrt(507)
## [1] 0.4174687

4.14 Thanksgiving spending, Part I.

The 2009 holiday retail season, which kicked o↵ 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.

The statement is FALSE. 436 American adults is a random sample of the population. Sample mean is always lies within a confident interval. We are 95% confident that the population average 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.

The statement is FALSE. Even though the sample’s distribution is right skewed this confidence interval is valid because sample size is large enough (larger than 40 without outlines) and the distribution is not strong. In our current case, n=436, which is well above 100 so we rely on the Central Limit Theorem for a normal sampling distribution.

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

The statement is FALSE. Sample mean is always lies within a confident interval.

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

The statement is TRUE. We are 95% confident that the population (all American adults) mean (average) is between $80.31 and $89.11.

  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.

The statement is TRUE.

  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.

The statement is FALSE. According to standard error formula ( se = sd/sqrt(n) ), we would need to use a sample 9 times larger.

sqrt(n)=3 n=9

  1. The margin of error is 4.4.
margin_error_error<-(89.11-80.31)/2
margin_error_error
## [1] 4.4

The statement is TRUE.

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.

  1. Are conditions for inference satisfied?

I believe that the conditions are satisfied because: 1. The distribution is not strongly skewed 2. The sample size is large enough (it’s greater than 30) 3. We can assume that random sample is independent since it was collected in a large city.

  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.

Null Hypothesis: mean equals to 32 Alternative Hypothesis: mean doesn’t equal to 32

#calculate standard error
se<-4.31/sqrt(36)

#calculate Z-score
Z<-(30.69-32)/se

#lower-tail hypothesis testing
p_value <- pnorm(Z)
p_value
## [1] 0.0341013
  1. Interpret the p-value in context of the hypothesis test and the data.

P-value allows to determine the significance of hypothesis testing results. Based on p-value result we should reject the null hypothesis since p-value is less than 0.1

1-p_value
## [1] 0.9658987

96.59% is greater than 90%. P-value falls into rejection region.

  1. Calculate a 90% confidence interval for the average age at which gifted children first count to 10 successfully.
lower <- 32 - (1.645 * se)
upper <- 32 + (1.645 * se)
lower
## [1] 30.81834
upper
## [1] 33.18166

A 90% confidence interval is (30.81834,33.18166)

  1. Do your results from the hypothesis test and the confidence interval agree? Explain.

They don’t contradict each other as hypothesis test proves that population mean is not equal to 32 and it’s with 90% likelihood that population mean lies within (30.81834,33.18166)

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.

  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.

Null Hypothesis: mean (average IQ) equals to 100 Alternative Hypothesis: mean (average IQ) doesn’t equal to 100

#calculate standard error
se <- 6.5/sqrt(36)

#calculate Z-score
Z<-(118.2-100)/se


#upper-tail hypothesis testing
p_value <- 1-pnorm(Z)
p_value
## [1] 0

We should reject null hypothesis since p-value is less than 0.1.

  1. Calculate a 90% confidence interval for the average IQ of mothers of gifted children.
lower <- 100 - (1.645 * se)
upper <- 100 + (1.645 * se)
lower
## [1] 98.21792
upper
## [1] 101.7821

A 90% confidence interval is (98.21792,101.7821).

  1. Do your results from the hypothesis test and the confidence interval agree? Explain.

They don’t contradict each other as hypothesis test proves that population mean is not equal to 100 and it’s with 90% likelihood that population mean lies within (98.21792,101.7821).

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

“Sampling distribution” of the mean represents the distribution of sample means. When the sample size is larger the distribution is more symmetric and the mean is closer to the median. In the other words, the samples of larger sizes is more normally distributed than the samples of smaller 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.

  1. What is the probability that a randomly chosen light bulb lasts more than 10,500 hours?
Z <- (10500 - 9000) / 1000

#upper-tail hypothesis testing
p <- 1 - pnorm(Z)
p
## [1] 0.0668072
  1. Describe the distribution of the mean lifespan of 15 light bulbs.
bulbs <- rnorm(15, mean=9000, sd = 1000)

hist(bulbs, probability = TRUE,breaks=10)
x <- 0:17000
y <- dnorm(x = x, mean = 9000, sd = 1000)
lines(x = x, y = y, col = "blue")

qqnorm(bulbs)
qqline(bulbs)

Looking at the plots above, I would say that the sample size is too small to decide whether it’s normally distributed or not. However, it’s might be normally distributed.

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

#clculate Z-score 
Z <-(10500-9000)/se
p_value <- pnorm(Z, mean=9000, sd=1000)
p_value
## [1] 1.189897e-19

Probability almost equals to 0.

  1. Sketch the two distributions (population and sampling) on the same scale.
#build sample using upper and lower interval boundaries (maean plus/minus  4 standard deviation which garantees 100% interval)
sample <- seq(9000 - (4 * 1000), 9000 + (4 * 1000), length=15)

#build sample using upper and lower interval boundaries (maean plus/minus 4 standard error which garantees 100% interval)
population<- seq(9000 - (4 * se), 9000 + (4 * se), length=15)

#build normal distribution
norm_sample <- dnorm(sample,9000,1000)
norm_population<- dnorm(population,9000,se)

plot(sample, norm_sample, type="l",col="blue",
xlab="Population and Sampling",
ylab="",main="Distribution of fluorescent light bulbs", ylim=c(0,0.002))
lines(population, norm_population, col="green")

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

Since the sample is not large enough and the distribution is skewed we can’t estimate the probabilities from parts (a) and (c) .

4.48 Same observation, di↵erent sample size. S

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.

se = sd/sqrt(n) : if sample size increases, standard error will decrease Z = (x-mean)/se : if sample size increases, Z-score will increase So, p-value will decrease