Chapter 4 Foundations for Inference

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

4.4 (a) 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 mean for height of active individual is 171.1 The median is 170.3

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

The standard deviation is 9.4 The IQR = Q3-Q1

#IQR = Q3-Q1
IQR= 177.8-163.8
IQR
## [1] 14
  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.
library(ggplot2)
meanHeight <- 171.1
sdHeight <- 9.4

x <- 180
zTall <- (x - meanHeight) / sdHeight
pTall <- pnorm(zTall, lower.tail = TRUE)
pTall
## [1] 0.8281318
library(ggplot2)
meanHeight <- 171.1
sdHeight <- 9.4

x <- 155
zshort <- (x - meanHeight) / sdHeight
pshort <- pnorm(zshort, lower.tail = TRUE)
pshort
## [1] 0.0433778
  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.

The random sample of physically individual does not be expected to be ones given mean and standard deviation, because the random of sample taken are different from the sample size, location taken, proportion between male and female are also the factor to determine the mean and standard deviation.

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

Standard error of sample mean= standard deviation divided by the square root of sample size standard deviation is 9.4 sample size is 507

#SE= sd / sqrt of sample n
SE <- 9.4 / sqrt(507)
SE
## [1] 0.4174687

174 P.208 4.14 Thanksgiving spending n=436 mean = 84.71 point estimate ± 1.96 x SE = 80.31 , 89.11

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

False, the 95% confident interval is calculating the plausible range of values for the population parameter, not for sample size.

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

False, the sample size is 436 larger than 30, a larger sample size can compensate for the right skewed.

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

Partially true, because it is 95% confident interval that population mean is in the interval and the sample mean has some variability around the population mean which can be qualified using the standard deviation of the distribution of sample means.

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

True, it is 95% confident interval that population mean is in the interval.

  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.

True, 90% confidence interval would be narrower than 95%, it mean it would be lower confidence.

  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.

False, margin of error = zSE = z(s/sqrt(n)), if confidence interval to be a third, it need 9 times larger.

  1. The margin of error is 4.4.

True, the margin of error is 4.4

me<- (89.11-80.31)/2
me
## [1] 4.4

P.211 4.24 Gifted children

Sample size n = 36 min = 21 mean = 30.69 sd = 4.31 max = 39

  1. Are conditions for inference satisfied? The distribution is not over skewed. It is bimodal distribution, the sample size is larger than 30, but only 36, if it is more sample size, it will be well approximated by a normal model.

  2. 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>=32): H0: u=32

H1: u<32

u<-32
smean<-30.69
sd<-4.31
n<-36

#standard error = se
se<-sd/sqrt(n)
se
## [1] 0.7183333
#calc z 
z<-abs(qnorm(0.05))
#z=(x-u)/se
x<-u-(z*se)
x
## [1] 30.81845

Rejection region is x<30.8, and sample mean 30.69 is smaller than 30.8 at rejected region, we reject the null hypothesis, so we can prove alternative hypothesis u<32 which is true.

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

P-value is 0.034, because the p-value is less thqn the significance level of 0.10, the hypotheiss is implausible. We reject the null hypothesis and concluded that gifted children first count to 10 successfully is less than general average of 32 months.

sd<-4.31
n<-36
#P-value=P(x<30.69)=P(Z<(30.69-32)/(sd/sqrt(n))
value<-((30.69-32)/(sd/sqrt(n)))


pvalue <- pnorm(value, lower.tail = TRUE)
pvalue
## [1] 0.0341013

When the population mean is assummed as 32, the probability of less than 30.69 P(x<30.69) is 0.034, so the probability of null hypothesis is very low and rejected.

  1. Calculate a 90% confidence interval for the average age at which gifted children first count to 10 successfully.
mean<-30.69
sd<-4.31
n<-36

#standard error = se
se<-sd/sqrt(n)
se
## [1] 0.7183333
#30.69 +/- (z-score for 90% confidence interval * se)
#30.69 +/- (1.645 * 0.72) = (29.51, 31.87)
z<-abs(qnorm(0.05))
z
## [1] 1.644854
lowervalue <- mean - (z * se)
uppervalue <- mean + (z * se)
lowervalue
## [1] 29.50845
uppervalue
## [1] 31.87155
  1. Do your results from the hypothesis test and the confidence interval agree? Explain.

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 (H0<=100): H0: u=100 H1: u>100 significance level = 0.10

n<-36
samplemean<-118.2
sd<-6.5
se<-sd/(sqrt(n))
zmean<-(samplemean-100)/se

#upper-tail:
pvalue <- 1-pnorm(zmean)
pvalue
## [1] 0

The probability of sample mean - 118.2 is 0, and is less than significance value - 0.10, we reject the null hypothesis and their IQ is greater than general population.

  1. Calculate a 90% confidence interval for the average IQ of mothers of gifted children.
samplemean<-118.2
sd<-6.5
n<-36

#standard error = se
se<-sd/sqrt(n)

#118.2 +/- (z-score for 90% confidence interval * se)
#118.2 +/- (1.645 * 0.72) 
z<-abs(qnorm(0.05))

lowervalue <- samplemean - (z * se)
uppervalue <- samplemean + (z * se)
lowervalue
## [1] 116.4181
uppervalue
## [1] 119.9819

Population mean of 100 is outside the 90% confidence interval.

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

Both reject the null hypothesis, the probability of sample mean - 118.2 is 0, and is less than significance value - 0.10, we reject the null hypothesis and their IQ is greater than general population and the population mean of 100 is outside the 90% confidence interval.

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 central limit theorem is the assumption of normality inherent within a relatively non-skewed distribution, having more than 30 independent samples.

It then factors the law of large numbers, which says that as we increase samples beyond the minimum theshold, we calibrate our sample mean, sd, se closer the the real, or population equivalents.

This is what the confidence interval statistically approximates. These statistical analyses are referred to as the sampling distribution of the mean.

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?
sd<-1000
n<-9000

z<-(10500-n)/sd
pnorm(z, lower.tail =FALSE)
## [1] 0.0668072
  1. Describe the distribution of the mean lifespan of 15 light bulbs.
sd<-1000
n<-9000

z<-(10500-n)/sd
pnorm(z, lower.tail =FALSE)
## [1] 0.0668072
  1. What is the probability that the mean lifespan of 15 randomly chosen light bulbs is more than 10,500 hours?
sd<-1000
n<-9000

se<-1000/sqrt(15)
z1<-(10500-n)/se
pnorm(z1, lower.tail =FALSE)
## [1] 3.133452e-09
  1. Sketch the two distributions (population and sampling) on the same scale.
mean<-9000
sd<-1000
se<-1000/sqrt(15)
normsample <- seq(mean - (5 * sd), mean + (5 * sd), length=5)
randomsample<- seq(mean - (5 * se), mean + (5 * se), length=5)
hnorm <- dnorm(normsample,mean,sd)
hrandom<- dnorm(randomsample,mean,se)

plot(normsample, hnorm, type="l",col="yellow",
xlab="Lightbulb Population vs Sampling",
ylab="",main="Distribution (population and sampling)", ylim=c(0,0.002))
lines(randomsample, hrandom, col="blue")

  1. Could you estimate the probabilities from parts (a) and (c) if the lifespans of light bulbs had a skewed distribution? No, it is assumed as normal distribution.

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.

standard error=standard deviation/square(sample size) Zscore=sample mean-population mean / standard error

The standard error decreases, the z-score increases, and therefore the p value will decrease.