oxygen = read.csv("https://raw.githubusercontent.com/kitadasmalley/sp21_MATH376LMT/main/data/oxygenPurity.csv", header = TRUE)
library(tidyverse)
## ── Attaching packages ────────────────────────────────────────────────────────── tidyverse 1.3.0 ──
## ✓ ggplot2 3.2.1 ✓ purrr 0.3.3
## ✓ tibble 2.1.3 ✓ dplyr 0.8.3
## ✓ tidyr 1.0.2 ✓ stringr 1.4.0
## ✓ readr 1.3.1 ✓ forcats 0.4.0
## ── Conflicts ───────────────────────────────────────────────────────────── tidyverse_conflicts() ──
## x dplyr::filter() masks stats::filter()
## x dplyr::lag() masks stats::lag()
The mean for purity is 91.818% and the standard deviation is 4.47888%.
## [1] 91.818
## [1] 4.478882
The mean for hydrocarbon is 1.1825% and the standard deiation is 0.236%
hist(oxygen$hydro)
hydro_mean = mean(oxygen$hydro)
hydro_sd = sd(oxygen$hydro)
hydro_mean
## [1] 1.1825
hydro_sd
## [1] 0.2367516
The plot is somewhat positive and linear since the majority of points accumulate at the bottom left and top right. The equation of the line is \[y = 0.02397x - 1.84507\]
plot(oxygen)
#SLR
slr= lm(oxygen$hydro~oxygen$purity)
abline(coefficients(slr), lty=2, col="blue")
slr
##
## Call:
## lm(formula = oxygen$hydro ~ oxygen$purity)
##
## Coefficients:
## (Intercept) oxygen$purity
## -1.84507 0.03297