Problem 4.4

a) Mean is 171.1cm, Median is 170.3cm

b) Standard deviation is 9.4cm, IQR is calculated below

177.7-163.8
## [1] 13.9
##c)Using a 95% confidence interval, the value should habe a z score between -2 and 2 to be usual
(180-171.1)/9.4
## [1] 0.9468085
(150-171.1)/9.4
## [1] -2.244681

Both the z scores are between 02 and 2 so both values are not unusual

d) Sample statistics change with samples so I would expect the values to be different.

e) The variability is called the standard error

\[ SE=\sigma /\sqrt { n } \]

Problem 4.14

95% Confidence interval is 80.31 to 89.11

a) False: We are 100% confidence that the mean 84.71 falls between these two values

b) False: According to Central limit theorem, since n>30, the sample mean is approximately normal and therefore it is appropriate to use a confidence interval.

c) False: The confidence interval is an estimate for the population mean and not the sample mean.

d) True: we are 95% confident that the interval contains the true population mean.

e) True: a 90% interval will be narrower than a 95%, we will be less sure that the interval contains the true population mean.

f) False: to reduce margin of error by a third, we need to multiply it by 9

\[ Margin Of Error = z *\sigma /\sqrt { n }\] ####g) True: Calculated below

r (89.11-80.31)/2

## [1] 4.4

Problem 4.24

a) Independance: Satisfies as sample is less than 10% of population of all children in a large city

Randomization: Satisfies, it is a random sample

Normal: Satisfied, sample size is larger than 30

b) H0:mu=32

Ha:mu>32

{ r} zscore= (30.69-32)/(4.31/sqrt(36)) zscore p=pnorm(zscore) p ####If p is less than 10%, reject null ####Therefore there is evidence that the average age at which gifted children first count to 10 is leass than the general average of 32 months. ####c) P value is 3.44% ####It means that given the population mean is 32 months, we have 3.44% chance of getting a sample of 36 children with average less than the mean of 30.69 months ####d)

upper<-30.69 +1.65*4.31/sqrt(36)
upper
## [1] 31.87525
lower<-30.69 -1.65*4.31/sqrt(36)
lower
## [1] 29.50475

e)The confidence interval does not include 32 and the hypothesis test rejected the notion that the population mean is 32

Therefore, they agree.

Problem 4.26

a)H0 : mu=100, Ha : Mu not equal to 100

z=(118.2-100)/6.5*sqrt(36)
z
## [1] 16.8

The probability is close to 0, so reject H0

There is sufficient evidence that supports that the average IQ of the mother of gifted children is different than the average IQ of the population

b)

upper<-118.2 + 1.65*(6.5/sqrt(36))
upper
## [1] 119.9875
lower<-118.2 - 1.65*(6.5/sqrt(36))
lower
## [1] 116.4125

116.41 to 119.99 is the confidence interval.

c) The confidence interval does not contain 100 and the hypothesis test rejects the null that average IQ is same as population mean of 100. So they agree.

Problem 4.34

Sampling Distribution of the mean is the distribution of the means from all possible samples.

The Central limit theorem says that the shape of the sampling distribution will be normal if sample size is equal to or higher than 30.

The mean of the sampling distribution is equal to the population mean.

As sample size increases, the spread decreases.

Problem 4.40

a)

1-pnorm(10500,9000,1000)
## [1] 0.0668072

The sampling and population distributiosn are approximately normal with a mean of 9000 and a standard deviation of 1000 hours.

SE<-1000/sqrt(15)
SE
####c)
z<-(10500-9000)/258
1-pnorm(z)
## [1] 3.050719e-09
####Probability is 0%

####d)

library(DATA606)
## Loading required package: shiny
## Warning: package 'shiny' was built under R version 3.5.2
## Loading required package: openintro
## Warning: package 'openintro' was built under R version 3.5.2
## Please visit openintro.org for free statistics materials
## 
## Attaching package: 'openintro'
## The following objects are masked from 'package:datasets':
## 
##     cars, trees
## Loading required package: OIdata
## Warning: package 'OIdata' was built under R version 3.5.2
## Loading required package: RCurl
## Warning: package 'RCurl' was built under R version 3.5.2
## Loading required package: bitops
## Loading required package: maps
## Warning: package 'maps' was built under R version 3.5.2
## Loading required package: ggplot2
## Warning: package 'ggplot2' was built under R version 3.5.2
## 
## Attaching package: 'ggplot2'
## The following object is masked from 'package:openintro':
## 
##     diamonds
## Loading required package: markdown
## Warning: package 'markdown' was built under R version 3.5.2
## 
## 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(9000, 1000)

normalPlot(9000, 1000/sqrt(15))

####e) No we cannot estimates parts a and c with a skewed distribution as we require the population distribution to be approximately normal.Sample size of 1 in part a and 15 in part c are too small to use the Central Limit Theorem.



#Problem: 4:48
####If sample size increases, Z value will increase. P is the probability of obtaining the value of the test statistic, or a more extreme value,when the null hypothesis is true. As Z increases, p value will decrease.