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.

  1. What is the point estimate for the average height of active individuals? What about the median?
  2. What is the point estimate for the standard deviation of the heights of active individuals? What about the IQR?
  3. 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.
  4. 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.
  5. 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 = \frac{\sigma}{\sqrt{n}}\))? Compute this quantity using the data from the original sample under the condition that the data are a simple random sample.

Answer of Heights of Adults:

First let’s look at the data set and summary of heights:

head(bdims$hgt)
## [1] 174.0 175.3 193.5 186.5 187.2 181.5
summary(bdims$hgt)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   147.2   163.8   170.3   171.1   177.8   198.1

(a): The point estimate for the average height is 171.1 and median is 170.3.

sd(bdims$hgt)
## [1] 9.407205

(b): The point estimate for the standard deviation is 9.4. The IQR is 3rd Qu - 1st Qu which is 177.8 - 163.8 = 14

(c): Calculate how many standard deviation away from the mean for both 180cm and 155cm height values.

z_180 <- (180-171.1)/9.4
z_150 <- (155-171.1)/9.4
z_180
## [1] 0.9468085
z_150
## [1] -1.712766

180 cm falls within 1 std away from the man. 155cm height falls within 2 std away from the mean. They are both not unusual heights.

(d): Sample statistics vary from sample to sample. So we dont expect the same mean and the standard deviation for this new sample set.

  1. Quantify how sample statistics vary is a way to estimate the margin of error. We can use standard error which is the standard deviation of the sampling distribution. \(SE=\sigma/\sqrt{n}\)
se <- 9.4/sqrt(507)
se
## [1] 0.4174687

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. We are 95% confident that the average spending of these 436 American adults is between $80.31 and $89.11.
  2. This confidence interval is not valid since the distribution of spending in the sample is right skewed.
  3. 95% of random samples have a sample mean between $80.31 and $89.11.
  4. We are 95% confident that the average spending of all American adults is between $80.31 and $89.11.
  5. A 90% confidence interval would be narrower than the 95% confidence interval since we don’t need to be as sure about our estimate.
  6. 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.
  7. The margin of error is 4.4.

Answer Thanksgiving spending

First let’s look at the summary of the dataset and spending

head(tgSpending$spending)
## [1]  52.84612 187.55311  63.87256 195.56842 120.78929  63.26765
summary(tgSpending$spending)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   5.719  49.177  75.792  84.707 112.255 282.803
sd(tgSpending$spending)
## [1] 46.92851

(a): Correct: We are 95% confident that ameircan spending average between $80.31 and $89.11

(b): False: The sampled observations are independent, they are randomly sampled. Sample is slighlty right skewed however it is not extremly skewed and the sample size is greater than 30.

(c): False: 95% confident means that 95% of the intervals contains the true population mean. This does not mean that 95% of the random samples have sample means between 80.31 and 89.11

(d): Correct:

(e): Correct: In order to increase the confidence level, we create wider intervals. So instead of 95% confidence level, we are norrowing down the interval for 90% confidence level. Interval would be narrower with less possible values in terms of spending in 90% confidence interval.

(f): \(SE=\sigma/\sqrt{n}\) based on this, n is the sample size, if we want to decrease the margin of error by 3 times, we would need to increase the sample size by more than 3 times. (at least 9 times)

(g): Correct: Confidence level is point estimate +- Z * SE and Z * SE is margin of error

se2 <- 46.92/sqrt(436)
# for 95% confidence level z= 1.96
z_2 <- se2 * 1.96
z_2
## [1] 4.404239

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.

  1. Are conditions for inference satisfied?
  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.
  3. Interpret the p-value in context of the hypothesis test and the data.
  4. Calculate a 90% confidence interval for the average age at which gifted children first count to 10 successfully.
  5. Do your results from the hypothesis test and the confidence interval agree? Explain.

Answer Gifted Children

First let’s look at the dataset and summary of count of gifted children

head(gifted$count)
## [1] 26 37 32 24 34 28
summary(gifted$count)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   21.00   28.00   31.00   30.69   34.25   39.00
sd(gifted$count)
## [1] 4.314887
  1. Yes. The observations are independent and randomly sampled. The sample size is less than 10% of the population (considering the population of a large city). The distribution is not extremly skewed.

  2. The associated hypothesis are

\(H_{o}: \mu= 32\) : Children on average 32 months count to 10 successfully.

\(H_{A}: \mu<32\) : Children on average less than 32 months count to 10 successfully.

The parameter of interest is the avertage months of children that counts to 10 successfully. We look at the test statistics to find how many standard deviations away from the sample mean.

\(SE=\sigma/\sqrt{n}\)

se <- 4.31/sqrt(36)
z <- (32-(30.69))/se
se
## [1] 0.7183333
z
## [1] 1.823666

The sample mean is 1.82 standard error away from the hypthesis value. We can quantify to see if this is unusual to accept or reject the hyphothesis by calculating p-value. If the pvalue is lower than significance level (0.10) we reject the \(H_{o}\)

pnorm(q=30.69, mean = 32, sd= se, lower.tail = TRUE)
## [1] 0.0341013

(c): p-value is 0.034 less than the signifance level of 0.10 , we reject the \(H_{o}\) . There is 0.034 chance of observing random sample of 36 children who are average 32 months first counted to 10 successfully.

(d): 90% confidence interval Z score is 1.64.

30.69 - (1.64*se)
## [1] 29.51193
30.69 + (1.64*se)
## [1] 31.86807

It is 29.5 to 31.86

(e): Yes. \(H_{A}\) which is less than 32 months count to 10 successfully. Both (29.51) and (31.86) are below 32.


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.

  1. Perform a hypothesis test to evaluate if the se 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.
  2. Calculate a 90% confidence interval for the average IQ of mothers of gifted children.
  3. Do your results from the hypothesis test and the confidence interval agree? Explain.

Answer Gifted Children Part 2

First lets get the dataset and summary of motheriq

head(gifted$motheriq)
## [1] 117 113 118 131 109 109
summary(gifted$motheriq)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   101.0   113.8   118.0   118.2   122.2   131.0
sd(gifted$motheriq)
## [1] 6.504943

(a): \(H_{o}: \mu=100\) : Data provide convincing evidence that the average IQ of mother of gifted children is same

\(H_{A}: \mu \neq 100\) : Different is the alternative hypothesis

# calculate se score
se_8 <- 6.5/sqrt(36)

# calculate z score
z_score <- (118.2-100)/se_8

# calculate p value 
pnorm(q=118.2, mean=100, sd=6.5, lower.tail = TRUE)
## [1] 0.9974449

The p value is 0.99. With significance level of 0.10, we reject the \(H_{o}\) hypthosis.

(b): 90% confidence interval Z score is 1.64.

118.2 - (1.64*se_8)
## [1] 116.4233
118.2 + (1.64*se_8)
## [1] 119.9767

(c): The confidence interval is 116.4 — 119.9, 100 is not within the interval, hence we reject the \(H_{o}\) which is the same as our hypethesis test.


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.

Answer CFLB

Sampling distribution is the distribution of sample means from a sample size. The variablity of the sampling distribution is smaller than the variability of the poupulation distribution as sample means will vary less than the individual observations. If we increase the sample size. sampling distribution shape will become more symmetric , center would become about the same and spread would become smaller.


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?
  2. Describe the distribution of the mean lifespan of 15 light bulbs.
  3. What is the probability that the mean lifespan of 15 randomly chosen light bulbs is more than 10,500 hours?
  4. Sketch the two distributions (population and sampling) on the same scale.
  5. Could you estimate the probabilities from parts (a) and (c) if the lifespans of light bulbs had a skewed distribution?

Answer CLT

(a):

m_bulbs <- 9000
sd_bulbs <- 1000
z_bulbs <- (10500-m_bulbs)/sd_bulbs
z_bulbs
## [1] 1.5
p_bulbs <- (1-pnorm(q=10500, mean = m_bulbs, sd=sd_bulbs))
p_bulbs
## [1] 0.0668072

(b):

The lifespan of the lightbulbs are nearly normally distributed. The sample size 15. mean is 9000.

se_bulbs <- sd_bulbs/sqrt(15)
se_bulbs
## [1] 258.1989

(c):

z_bulbs_sample <- ((10500-m_bulbs)/se_bulbs)
p_sample_bulbs <- (1-pnorm(q=10500, mean = m_bulbs, sd=se_bulbs))
p_sample_bulbs
## [1] 3.133452e-09

(d):

#using normal plot
library('DATA606')
## Loading required package: shiny
## Loading required package: OIdata
## Loading required package: RCurl
## Loading required package: bitops
## Loading required package: maps
## Loading required package: ggplot2
## 
## Attaching package: 'ggplot2'
## The following object is masked from 'package:openintro':
## 
##     diamonds
## Loading required package: markdown
## 
## Welcome to CUNY DATA606 Statistics and Probability for Data Analytics 
## This package is designed to support this course. The text book used 
## is OpenIntro Statistics, 3rd Edition. You can read this by typing 
## vignette('os3') or visit www.OpenIntro.org. 
##  
## The getLabs() function will return a list of the labs available. 
##  
## The demo(package='DATA606') will list the demos that are available.
## 
## Attaching package: 'DATA606'
## The following object is masked from 'package:utils':
## 
##     demo
normalPlot(mean=m_bulbs, sd=sd_bulbs)

normalPlot(mean = m_bulbs, sd=se_bulbs)

  1. : If the ligh bulbs have skewed distribution, we would not be able to estimate the probabilities from (a) and (c).

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.

Answer Same observation, different sample size:

Basically our sample size became x10. The standard error will deacrease. The spread of the sample distribution will get bigger. p value will decrease.