Questions

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.

4.4.a

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

The point estimator is the mean or 171.1 cm. The median is the 170.3 cm.

4.4.b

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 is 9.4 cm.

The IQR is 14 cm.

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

xbar <- 171.1
sd <- 9.4
val <- 180
x = round(pnorm(val, xbar, sd, lower.tail = F) * 100 , 2)
y = round((val - xbar)/sd, 2)

There is an 17.19% chance that a randomly drawn individual is 180 or taller. This doesn’t seem unusual. That hight also only 0.95 standard deviations away. So while it falls outside of the IQR, it’s still pretty usual.

val <- 155
x = round(pnorm(val, xbar, sd, lower.tail = T) * 100 , 2)
y = round((val - xbar)/sd, 2)

There is a 4.34% chance that a person will be 155 cm tall. This falls below the typical 95% CI. Also this person would be -1.71 standard deviations away from the mean. One could make the argument that this person is unusual becuase unusual results are said to be over 95% CI. However, this is one observation not a mean of a treatment so it’s a bit weird. Imagine passing 100 people on the street. 4 of them would be this short. It’s not that crazy.

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

The mean and SD of a new sample would almost certainly not be the same. The chances of a mean being the same for two samples for a continous variable approach zero. (Area under a curver for a single point is zero.) Since there seems to be a precision amount in the calculations (e.g., the results are rounded to one decimal) we could calculate the actual chance of getting an observed mean that is the same, although the true mean would be different. To calculate this we also need to know the population mean. So really, the the chances are very low.

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

n <- 507
se <- sd/sqrt(n) 
se %>% round(2)
## [1] 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. 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.

library(openintro)
## Warning: package 'openintro' was built under R version 3.4.1
## Please visit openintro.org for free statistics materials
## 
## Attaching package: 'openintro'
## The following objects are masked from 'package:datasets':
## 
##     cars, trees
hist(tgSpending$spending)

4.14.a

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

Answer: F: We are 95% certain the the TRUE mean of spending is between $80.31 and $89.11. The average spending of the sample is exactly $84.71

4.14.b

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

Answer: F: While the sample (and probably the population is skewed) the CLT lets us estimate the CI for the mean.

4.14.c

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

Answer: F: We don’t know the population me so we can’t make inferences about the distrobution of sample means. We only know there is a 95% chance that the means is in the CI. We can’t say that 95% of samples will fall in this. (We could say that if this was our population and we took smaller sample sizes e.g., 30).

4.14.d

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

Answer T: Thats the definitinion of a CI.

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

Answer T: We don’t need to be as certain so we can have a narrower CI.

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

Answer F: We would need to make it 9 times larger because \[ z \cdot se= \frac{z \cdot\sigma}{\sqrt{n}} \] \[\frac{se}{3}= \frac{z \cdot\sigma}{3 \cdot \sqrt{n}}\] \[\frac{z \cdot se}{3}= \frac{z \cdot\sigma}{9^{1/2}\cdot\sqrt{n}}\] \[\frac{z \cdot se}{3}= \frac{z \cdot\sigma}{\sqrt{n\cdot9}}\] ### 4.14.g

The margin of error is 4.4.

Answer: T:

The MOE is half the distance of the CI or rather the distance from the mean to one of the critical values.

moe <- 89.11- 84.71
moe
## [1] 4.4

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

library(ggplot2)
## 
## Attaching package: 'ggplot2'
## The following object is masked from 'package:openintro':
## 
##     diamonds
library(openintro)
hist(gifted$read, bins = 1)
## Warning in plot.window(xlim, ylim, "", ...): "bins" is not a graphical
## parameter
## Warning in title(main = main, sub = sub, xlab = xlab, ylab = ylab, ...):
## "bins" is not a graphical parameter
## Warning in axis(1, ...): "bins" is not a graphical parameter
## Warning in axis(2, ...): "bins" is not a graphical parameter

qplot(count, data = gifted, bins = 10)

summary(gifted)
##      score          fatheriq        motheriq         speak   
##  Min.   :150.0   Min.   :110.0   Min.   :101.0   Min.   :10  
##  1st Qu.:155.0   1st Qu.:112.0   1st Qu.:113.8   1st Qu.:17  
##  Median :159.0   Median :115.0   Median :118.0   Median :18  
##  Mean   :159.1   Mean   :114.8   Mean   :118.2   Mean   :18  
##  3rd Qu.:162.0   3rd Qu.:116.2   3rd Qu.:122.2   3rd Qu.:20  
##  Max.   :169.0   Max.   :126.0   Max.   :131.0   Max.   :23  
##      count            read           edutv          cartoons    
##  Min.   :21.00   Min.   :1.700   Min.   :0.750   Min.   :1.750  
##  1st Qu.:28.00   1st Qu.:2.000   1st Qu.:1.750   1st Qu.:2.688  
##  Median :31.00   Median :2.200   Median :2.000   Median :3.000  
##  Mean   :30.69   Mean   :2.136   Mean   :1.958   Mean   :3.062  
##  3rd Qu.:34.25   3rd Qu.:2.300   3rd Qu.:2.250   3rd Qu.:3.500  
##  Max.   :39.00   Max.   :2.500   Max.   :3.000   Max.   :4.500

4.24 (a)

Are conditions for inference satisfied?

There are 36 people in the sample. It’s small but some inference could be made.

4.24 (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 first count to 10 successfully is less than the general average of 32 months. Use a significance level of 0.10.

library(dplyr)
statsGif <- gifted %>% 
  select(count) %>% 
  summarise(meanGift = mean(count),
            sdGift = sd(count),
            nGift = n())

x <- pnorm(32, mean = statsGif$meanGift, sd = statsGif$sdGift, lower.tail = F)
t.test(gifted$count, alternative = "two.sided", mu = 32)
## 
##  One Sample t-test
## 
## data:  gifted$count
## t = -1.8154, df = 35, p-value = 0.07804
## alternative hypothesis: true mean is not equal to 32
## 95 percent confidence interval:
##  29.23450 32.15439
## sample estimates:
## mean of x 
##  30.69444

The t.test returns a value of 0.078 which is less than 0.1 so we can reject the null that there is no difference between the groups.

4.24 (c)

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

See above.

4.24 (d)

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

t.test(gifted$count, alternative = "two.sided", conf.level = .9)
## 
##  One Sample t-test
## 
## data:  gifted$count
## t = 42.682, df = 35, p-value < 2.2e-16
## alternative hypothesis: true mean is not equal to 0
## 90 percent confidence interval:
##  29.47939 31.90950
## sample estimates:
## mean of x 
##  30.69444

4.24 (e)

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

Yes, which is unsurprising.

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.

hist(gifted$motheriq)

4.26.a

Perform a hypothesis test to evaluate if these data provide convincing evidence that the average IQ of mothers of gifted children is diferent than the average IQ for the population at large, which is 100. Use a significance level of 0.10.

t.test(gifted$motheriq, alternative = "two.sided", mu = 100) #conf.level = .9
## 
##  One Sample t-test
## 
## data:  gifted$motheriq
## t = 16.756, df = 35, p-value < 2.2e-16
## alternative hypothesis: true mean is not equal to 100
## 95 percent confidence interval:
##  115.9657 120.3676
## sample estimates:
## mean of x 
##  118.1667

It there is a very high chance that the mother’s iq is different from the mean of 100.

4.26.b

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

t.test(gifted$motheriq, alternative = "two.sided", conf.level = .9) #conf.level = .9
## 
##  One Sample t-test
## 
## data:  gifted$motheriq
## t = 108.99, df = 35, p-value < 2.2e-16
## alternative hypothesis: true mean is not equal to 0
## 90 percent confidence interval:
##  116.3349 119.9984
## sample estimates:
## mean of x 
##  118.1667

4.26.c

Do your results from the hypothesis test and the confidence interval agree? Explain. Yes, it makes sense that the CI does not contain the pop mean of 100 because the p value for mothers is greater.

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.

The sampling distribution of the mean is the distrobution means of randomly selected samples of of a population. As n increases, the sampeling distrobution of the mean approaches a normal distrobution even if the initial data is not normal.

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.

4.40.a

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

pnorm(10500, 9000, 1000, lower.tail = F)
## [1] 0.0668072

So just within the 95 CI range.

4.40.b

Describe the distribution of the mean lifespan of 15 light bulbs. \[ \bar X \sim N \Large( 9000, \frac{1000^2}{15} \Large)\]

4.40.c

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

pnorm(10500, 9000, 1000/sqrt(15), lower.tail = FALSE)
## [1] 3.133452e-09

So not very big.

4.40.d

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

se <- 1000/sqrt(15)
sampleN <- seq(9000 - (4 * 1000), 9000 + (4 * 1000), length=15)
sampleR <- seq(9000 - (4 * se), 9000 + (4 * se), length=15)
norm1 <- dnorm(sampleN,9000,1000)
norm2 <- dnorm(sampleR,9000,se)

plot(sampleN, norm1, type="l",col="blue",
     xlab=" Pop vs Samp", 
     main=" CFLBs",
     ylim=c(0,0.002))
lines(sampleR, norm2, col="red")

4.40.e

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

Not really because of the small sample size.

4.48 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 will decrease because:

\[ t = \frac{\bar x - \mu}{s/\sqrt{n}} \] \[t= \frac{(\bar x -\mu) \cdot n^{0.5}}{s}\] \[\frac{ \partial t }{\partial n} = \frac{(\bar x -\mu) }{2s \cdot n^{0.5}} > 0\] So as n increases so does t which casues the p- value to get smaller.