4.4
4.14
4.24
n<- 36
sample_mean <- 30.69
pop_mean <- 32
sd <- 4.31
(se <- sd/sqrt(n))
## [1] 0.7183333
(z <- (sample_mean-pop_mean)/se)
## [1] -1.823666
pnorm(z)
## [1] 0.0341013
Given the plausible range of values for the population mean indicated by the confidence interval, we cannot reject the null hypothesis.
As shown above, the p-value is less than significance level .10, thus we reject the null hypothesis.
Calculate 90% confidence interval:
(confidence_interval <- c((sample_mean-(1.645*se)),(sample_mean + (1.645*se))))
## [1] 29.50834 31.87166
4.26
pop_mean <- 100
smp_mean <- 118.2
(se<- 6.5/sqrt(36))
## [1] 1.083333
(z <- (smp_mean-pop_mean)/se)
## [1] 16.8
1-pnorm(z)
## [1] 0
(confidence_interval <- c((smp_mean-(1.645*se)),(smp_mean + (1.645*se))))
## [1] 116.4179 119.9821
4.34
The sampling distribution of the mean refers to the distribution of all the possible means of samples of length n. As the sample size increases the center approaches the population mean, the curve approaches normal, and the spread becomes smaller.
4.40
mean<-2.5
sd<-.03
pnorm(2.4,mean,sd)
## [1] 0.0004290603
(se <- sd/sqrt(10))
## [1] 0.009486833
pnorm(2.4,2.5,se)
## [1] 2.797279e-26
library(DATA606)
## Loading required package: shiny
## Loading required package: openintro
## 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
## 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
par(mfrow=c(1,2))
normalPlot(2.5,.03,bounds=c(-5,2.4)) #Randomly chosen penny less than 2.4
normalPlot(2.5,se,bounds=c(-5,2.4)) #Mean of sample n=10 less than 2.4
4.48
The p-value of the sampling distribution is derived from the z-score, the z-score is calculated using the standard error, which is in-turn calculated using the sample size such that zscore = (sample_mean - pop_mean) / (sample_std_dev / sqrt(sample_size)) As shown below, when the sample size increases, the absolute value of the zscore will also increase (negative will become smaller, positive greater). As a result, the associated p-value will decrease.
sample_size <- 30
sample_mean <- 10
pop_mean <- 11
sample_std_dev <- 1
(zscore <- (sample_mean - pop_mean) / (sample_std_dev / sqrt(sample_size)))
## [1] -5.477226
sample_size <- 60
(zscore <- (sample_mean - pop_mean) / (sample_std_dev / sqrt(sample_size)))
## [1] -7.745967