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.3 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.2
## 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(mosaic)
## Warning: package 'mosaic' was built under R version 4.0.2
## Registered S3 method overwritten by 'mosaic':
## method from
## fortify.SpatialPolygonsDataFrame ggplot2
##
## The 'mosaic' package masks several functions from core packages in order to add
## additional features. The original behavior of these functions should not be affected by this.
##
## Attaching package: 'mosaic'
## The following object is masked from 'package:Matrix':
##
## mean
## The following objects are masked from 'package:dplyr':
##
## count, do, tally
## The following object is masked from 'package:purrr':
##
## cross
## The following object is masked from 'package:ggplot2':
##
## stat
## The following objects are masked from 'package:stats':
##
## binom.test, cor, cor.test, cov, fivenum, IQR, median, prop.test,
## quantile, sd, t.test, var
## The following objects are masked from 'package:base':
##
## max, mean, min, prod, range, sample, sum
getwd()
## [1] "C:/Users/Jerome/Documents/From_Toshiba_HD_Work_Files/0000_Montgomery_College/Math_217/Exam_1"
Question 1c
pnorm(125,112,6.8) - pnorm(90, 112, 6.8)
## [1] 0.9714392
Question 1d
qnorm(.95, 112,6.8)
## [1] 123.185
Question 5
fludeaths <-c(35, 41, 55, 65, 29, 60, 49, 24, 37, 110, 28, 40, 47, 58, 30, 37, 15, 50, 28)
id <-c(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19)
fd <- data.frame(id,fludeaths)
hist(fd$fludeaths, main= "Flu Deaths over 19 Years", ylab = "# of Flu Deaths")
avg <- mean(fd$fludeaths)
med <- median(fd$fludeaths)
abline(v = avg, col = "red")
abline(v = med, col = "blue")

summary (fd$fludeaths)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 15.00 29.50 40.00 44.11 52.50 110.00
sd(fd$fludeaths)
## [1] 20.84038
boxplot (fd$fludeaths, main = "Flu Deaths over 19 Years", col = "blue")
