Heights of adults. (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.
hgt_mean <- mean(bdims$hgt)
hgt_median <- median(bdims$hgt)
paste0('The mean is ',round(hgt_mean,2),'. The median is ',round(hgt_median,2),collapse='')
## [1] "The mean is 171.14. The median is 170.3"
hgt_sd <- sd(bdims$hgt)
hgt_iqr <- IQR(bdims$hgt)
paste0('The standard deviation is ',round(hgt_sd,2),'. The IQR is ',round(hgt_iqr,2),collapse='')
## [1] "The standard deviation is 9.41. The IQR is 14"
Since the shapiro test shows that the height variable is not normal I can not use a normal distribution to check where the values fall. From eyeballing the distribution I would say 180 is fairly normal, while 155 is on the unusually short side.
shapiro.test(bdims$hgt)
##
## Shapiro-Wilk normality test
##
## data: bdims$hgt
## W = 0.99233, p-value = 0.01045
No the mean and standard deviation should not be the same since it is a random sample of the participants. However, most of the time it should be reflective of the mean and std, but sometimes it will not be inside the ball park.
n=length(bdims$hgt)
sd_x <- hgt_sd/n^(1/2)
paste0('The standard error is ',round(sd_x,3))
## [1] "The standard error is 0.418"
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.
## [1] 84.70677
## [1] 46.92851
False because we know the average spending is $84.70.
False the confidence interval can still be valid even if the distribution is skewed.
False. The data being used is a sample and other samples will have different intervals.
True. We know the average spending is between $80.31 and $89.11
True. A 90% confidence interval captures less of the possible values of the mean.
This is false. Part of the formula for getting the standard error is to take the square root of the sample size, so in order to get a sample three times larger you would have to square the 3. Which equals 9. The sample size would have to be 9 times larger.
margin of error equals z * sd/sqrt(n). Which would be 1.96 * 46.93/sqrt(436)=4.405. This is true.
Gifted children, Part I. Researchers investigating characteristics of gifted children col- lected 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.
The data seems to be random. While being skewed and bimodal the data seems to be normally distributed. Assuming that children were taken from a variety of different backgrounds then yes the data is independent.
\(H_O: \mu= 32 months\) \(H_1:\mu<32\) \(SE_\bar{x}=\frac{s}{\sqrt{n}} \Rightarrow \frac{4.31}{\sqrt{36}}=.718\) \(Z=\frac{\bar{x}-\mu}{SE_\bar{x}} \Rightarrow \frac{30.69-32}{.718}=-1.8245\)
## [1] "p-value = 0.034 < .1, hence, we reject the null hypothesis"
Since \(H_1: \mu<32\), with a significance value of .1, the p-value represents the probability that \(\mu\) is less than the significance value. The lower the p-value the greater probability that the observed difference has statistical significance ./p>
Yes they agree since the upper bound value is 31.87. Which is less than 32, like the alternate hypothesis states.
Gifted children, Part II. 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.
n <- 36
min <- 101
mean <- 118.2
sd <- 6.5
max <- 131
se <-sd/n^(1/2)
z <- round(qnorm(.95),2)
prob<-pnorm(100,118.2,se)
paste0('p-value = ',round(prob,15),' < .1, hence, we reject the null hypothesis',collapse='')
## [1] "p-value = 0 < .1, hence, we reject the null hypothesis"
lower <- round(mean-z*se,3)
upper <- round(mean+z*se,3)
confidence interval: \(lower bound =\mu-Z*SE\Rightarrow 118.2-1.64*1.0833333=116.423\) \(upper bound = \mu+Z*SE\Rightarrow 118.2-1.64*1.0833333=119.977\) (c) Do your results from the hypothesis test and the confidence interval agree? Explain.
Yes, because the mean IQ for mothers of gifted kids falls within the interval.
The sampling distribution of the mean is when you take point estimates,such as mean, of samples that are all a fixed size. The center remains pretty much the same, while the shape normalizes and spread tends to narrow as the sample size increases.
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.
cflb_mean <- 9000
cflb_sd <-1000
cflb_x <- 10500
p <- round(pnorm(cflb_x,cflb_mean,cflb_sd,lower.tail = F),4)
The probability that a randomly chosen light bulb lasts more than 10,500 hours is 6.68%
cflb_se <- cflb_sd/15^.5
prob_c <- round(pnorm(cflb_x,cflb_mean,cflb_se,lower.tail = F),4)
The probability that 15 randomly chosen light bulbs lifespan is more than 10,500 hours is 0.
norm <- seq(cflb_mean - (4 * cflb_sd), cflb_mean + (4 * cflb_sd), length=25)
ran<- seq(cflb_mean - (4 * cflb_se), cflb_mean + (4 * cflb_se), length=25)
densnorm <- dnorm(norm, cflb_mean, cflb_sd)
rannorm <- dnorm(ran, cflb_mean, cflb_se)
plot(norm, densnorm, type="l",col="black",
xlab="Lightbulb Population vs Sampling",
ylim=c(0,0.002))
lines(ran, rannorm, col="yellow")
No because the sample size of c is not big enough to assume normality. C would have to be at least n=30.
By enlarging the n, which is the denominator of the standard error’s formula, it will decrease the standard error. This in turn will decrease the p-value. Since the sample size increased by a multiple of ten, I would imagine that the new p-value would be significantly smaller than .08
n=500
se <-sd/n^(1/2)
z <- round(qnorm(.95),2)
prob<-pnorm(100,118.2,se)
prob
## [1] 0