1.) Complete part (c) of Exercise 1.5 in the textbook

-5, -5, 0, 0, 4, 6

2.) a.) Exercise 1.7
A - W
B - Z
C - V
D - Y
E - U
F - X

2.) b.) Describe the shape of each distribution A-F from a.) using correct terminology. A - Symmetric and unimodal
B - Skewed Right
C - SKewed Left
D - Distribution is spread out evenly from 0 to 10
E - Distribution is spread out to the extreme ends
F - Unimodal and not spread out and focused in the center

3.) Prove that the sum of deviations from the mean is equal to zero.
First we will expand the summation of the deviations. Then like terms will combine and cancel out :
\[ \sum_{n=1}^{\infty} (x_n - \bar{x} )= (x_1 - \bar{x} )+(x_2 - \bar{x} )+...+(x_n - \bar{x} ) \\ = (x_1 + x_2 +...+ x_n) - n(\bar{x})\\ =\sum_{n=1}^{\infty} (x_n) - \frac{n\sum_{n=1}^{\infty}(x_n)} n \\ \sum_{n=1}^{\infty}(x_n) - \sum_{n=1}^{\infty} (x_n) = 0 \] Since n times the mean is the same value of all the values added up, when subtracted the result is 0. Thus completing the proof.

4.)a.) Create a two way table of gender and participating in a sports team this fall.

library(fastR2)
## Loading required package: ggformula
## Loading required package: ggplot2
## 
## New to ggformula?  Try the tutorials: 
##  learnr::run_tutorial("introduction", package = "ggformula")
##  learnr::run_tutorial("refining", package = "ggformula")
## Loading required package: mosaic
## Loading required package: dplyr
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
## Loading required package: lattice
## Loading required package: mosaicData
## Loading required package: Matrix
## 
## 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.
## 
## Note: If you use the Matrix package, be sure to load it BEFORE loading mosaic.
## 
## 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 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
 ClassSurvey = read.csv("C:/Users/jlwol/Downloads/ClassSurveyResults.csv", header=T, na.strings ="?")
 head(ClassSurvey)
##   Gender  Class Greek Sports         Prize   Bed Pulse Work Height Number
## 1   Male Junior    No    Yes Olympic Medal  0:30    44    0     70      4
## 2   Male Junior    No     No   Nobel Prize  0:00    54    5     71      6
## 3   Male Junior    No     No   Nobel Prize  0:30    79   20     66     19
## 4   Male Senior    No    Yes Olympic Medal 23:30    80    2     65      4
## 5   Male Senior   Yes    Yes   Nobel Prize 23:00    65   10     70      7
## 6 Female Junior   Yes    Yes Olympic Medal  1:30    66   12     64     18
 table(ClassSurvey$Gender, ClassSurvey$Sports)
##         
##          No Yes
##   Female  4   2
##   Male    7   5

4.)b.) Create an appropriate graphical display to depict which award students in this class would prefer to win.

prizes = table(ClassSurvey$Prize)
barplot(prizes)

mosaicplot(prizes)

#Shows the Olympic Medal was the most prefered award.

4.)c.) Create an appropriate graphical display to depict the typical number of hours each student works per week

hist(ClassSurvey$Work, data = ClassSurvey)
## Warning in plot.window(xlim, ylim, "", ...): "data" is not a graphical
## parameter
## Warning in title(main = main, sub = sub, xlab = xlab, ylab = ylab, ...):
## "data" is not a graphical parameter
## Warning in axis(1, ...): "data" is not a graphical parameter
## Warning in axis(2, ...): "data" is not a graphical parameter

#The histogram shows that the majority of students work 0-5 hours or 15-20 hours.

4.)d.) Use appropriate graphical and numerical summaries to explore the relationship between a qualitative variable and a quantitative variable (of your choice) from the ‘ClassSurveyResults.csv’ file on Moodle. Write a few sentences to report findings.

histogram(~ClassSurvey$Height|ClassSurvey$Class)

#Shows two histograms one for the Juniors and one for the Seniors. The Juniors histogram showed a higher amount of taller students than the Senior students. 

5.)

mean(ClassSurvey$Pulse)
## [1] 70.77778
sd(ClassSurvey$Pulse)
## [1] 13.08144
quantile(ClassSurvey$Pulse)
##    0%   25%   50%   75%  100% 
## 44.00 64.25 71.00 79.00 98.00
 boxplot(ClassSurvey$Pulse)