## Rows: 70 Columns: 2
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (1): HANDICAP
## dbl (1): SCORE
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.

Problem 1

## Code for Question 3
mean(Handicap$SCORE)
## [1] 4.928571
## Variance
sd(Handicap$SCORE)
## [1] 1.718792
## Code for Question 4
attach(Handicap)
## Finds mean by Handicap type
mean(SCORE ~ HANDICAP)
##    AMPUTEE   CRUTCHES    HEARING       NONE WHEELCHAIR 
##   4.428571   5.921429   4.050000   4.900000   5.342857
## Variance of means by Handicap
sd(mean(SCORE ~ HANDICAP))
## [1] 0.7382584
## Variance of groups by Handicap
sd(SCORE ~ HANDICAP)
##    AMPUTEE   CRUTCHES    HEARING       NONE WHEELCHAIR 
##   1.585719   1.481776   1.532595   1.793578   1.748280
## Mean of Variance
mean(sd(SCORE ~ HANDICAP))
## [1] 1.62839
## Code for Question 5
dox_aov(SCORE ~ HANDICAP, Handicap)
ANOVA Summary
Df Sum Sq Mean Sq F value Pr(>F)
HANDICAP 4 30.52 7.630 2.862 0.03013
Residuals 65 173.32 2.666 NA NA
Total 69 203.84 NA NA NA
dox_boxplot(SCORE ~ HANDICAP, Handicap)

## Question 7
x <- rf(10000, 4, 65)
hist(x)
abline(v=2.862)

## Question 8
dox_resid(SCORE ~ HANDICAP, Handicap)

Problem 2

## New names:
## Rows: 46 Columns: 8
## ── Column specification
## ──────────────────────────────────────────────────────── Delimiter: "," chr
## (1): Judge dbl (1): Percent lgl (6): ...3, ...4, ...5, ...6, ...7, ...8
## ℹ Use `spec()` to retrieve the full column specification for this data. ℹ
## Specify the column types or set `show_col_types = FALSE` to quiet this message.
## • `` -> `...3`
## • `` -> `...4`
## • `` -> `...5`
## • `` -> `...6`
## • `` -> `...7`
## • `` -> `...8`
## Boxplot
dox_boxplot(Percent ~ Judge, spock)

## ANOVA
dox_aov(Percent ~ Judge, spock)
## # A tibble: 7 × 2
##   Judge     n
##   <chr> <int>
## 1 A         5
## 2 B         6
## 3 C         8
## 4 D         2
## 5 E         7
## 6 F         9
## 7 Spock     9
ANOVA Summary
Df Sum Sq Mean Sq F value Pr(>F)
Judge 6 1850 308.3 6.279 0.0001108
Residuals 39 1915 49.1 NA NA
Total 45 3764 NA NA NA

Problem 3

## Rows: 36 Columns: 3
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (2): Building, Location
## dbl (1): Count
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
## W/o Log count 
dox_aov(Count ~ Building + Location, HW13Bacteria)
ANOVA Summary
Df Sum Sq Mean Sq F value Pr(>F)
Building 5 3845562 769112 7.3797 0.0001602
Location 2 206372 103186 0.9901 0.3841829
Residuals 28 2918163 104220 NA NA
Total 35 6970097 NA NA NA
dox_boxplot(Count ~ Building + Location, HW13Bacteria)

dox_resid(Count ~ Building + Location, HW13Bacteria)

## mutation for log
df1 <- mutate(HW13Bacteria, logcount = log(Count))
## W/ logcount
dox_aov(logcount ~ Building + Location, df1)
ANOVA Summary
Df Sum Sq Mean Sq F value Pr(>F)
Building 5 36.181 7.236 6.087 0.0006198
Location 2 3.016 1.508 1.268 0.2969377
Residuals 28 33.287 1.189 NA NA
Total 35 72.484 NA NA NA
dox_boxplot(logcount ~ Building + Location, df1)

dox_resid(logcount ~ Building + Location, df1)