library(tidyverse)
## Warning: package 'tidyverse' was built under R version 4.0.2
## -- Attaching packages --------------------------------------- tidyverse 1.3.0 --
## v ggplot2 3.3.2     v purrr   0.3.4
## v tibble  3.0.4     v dplyr   1.0.2
## v tidyr   1.1.2     v stringr 1.4.0
## v readr   1.4.0     v forcats 0.5.0
## Warning: package 'tibble' was built under R version 4.0.3
## Warning: package 'tidyr' was built under R version 4.0.2
## Warning: package 'dplyr' was built under R version 4.0.2
## -- Conflicts ------------------------------------------ tidyverse_conflicts() --
## x dplyr::filter() masks stats::filter()
## x dplyr::lag()    masks stats::lag()
library(infer)
## Warning: package 'infer' was built under R version 4.0.2
library(BSDA)
## Warning: package 'BSDA' was built under R version 4.0.3
## Loading required package: lattice
## 
## Attaching package: 'BSDA'
## The following object is masked from 'package:datasets':
## 
##     Orange
getwd()
## [1] "C:/Users/Jerome/Documents/From_Toshiba_HD_Work_Files/0000_Montgomery_College/Math_217/Exam_2"

Problem 1

meanbw = 114
s  = 24
SE = s/sqrt(100)
E = qt(.975, df = 100-1)*SE
meanbw + c(-E,E)
## [1] 109.2379 118.7621
print(meanbw)
## [1] 114
print(SE)
## [1] 2.4

Problem 6.

(a)

tsum.test(107.7,9.5, 195, 115.3,14.9,96)
## 
##  Welch Modified Two-Sample t-Test
## 
## data:  Summarized x and y
## t = -4.5619, df = 134.2, p-value = 1.131e-05
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -10.894936  -4.305064
## sample estimates:
## mean of x mean of y 
##     107.7     115.3

Question 8.

ecoli <- c(20,11)
sterile <- c(8,32)
df <- data.frame(ecoli,sterile)
chisq.test(df)
## 
##  Pearson's Chi-squared test with Yates' continuity correction
## 
## data:  df
## X-squared = 12.687, df = 1, p-value = 0.0003683