Read in data for energy cost

energy = read.table("energy_cost.csv", header = TRUE, sep = ",")

Problem 3g

hist(energy$cost, xlab = "Monthly Energy Bill", main = "Energy Cost")

Problem 3h

boxplot(energy$cost, xlab = "Monthly Energy Bill", main = "Energy Cost" )

Problem 3i

mean(energy$cost)
## [1] 174.0667
sd(energy$cost)
## [1] 49.49534
summary(energy$cost)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##    64.0   147.5   181.0   174.1   203.0   274.0
nrow(energy)
## [1] 30

Problem 3n

qt(.025,29)
## [1] -2.04523

Problem 3q: Critical value

qt(.05, 29)
## [1] -1.699127

Problem 3q: P-value

pt(-2.87, 29)
## [1] 0.00379273