Question 1 Functions

library(ggplot2)
source("Homework_9.R")
w <- GenDataFunc()
## 'data.frame':    3000 obs. of  2 variables:
##  $ ID   : int  1 2 3 4 5 6 7 8 9 10 ...
##  $ myVar: num  5.87 7.42 6.11 3.96 4.7 ...
x <- SummaryFunc(w)
## 'data.frame':    3000 obs. of  2 variables:
##  $ ID   : int  1 2 3 4 5 6 7 8 9 10 ...
##  $ myVar: num  6 6.3 5.42 4.83 5.74 ...
##        ID             myVar      
##  Min.   :   1.0   Min.   :1.848  
##  1st Qu.: 750.8   1st Qu.:4.983  
##  Median :1500.5   Median :5.669  
##  Mean   :1500.5   Mean   :5.662  
##  3rd Qu.:2250.2   3rd Qu.:6.338  
##  Max.   :3000.0   Max.   :9.183
y <- ANOVAFunc()
## Call:
##    aov(formula = resVar ~ TGroup, data = ANOdata)
## 
## Terms:
##                   TGroup Residuals
## Sum of Squares  15190673      1601
## Deg. of Freedom        1        91
## 
## Residual standard error: 4.194475
## Estimated effects may be unbalanced
##             Df   Sum Sq  Mean Sq F value Pr(>F)    
## TGroup       1 15190673 15190673  863420 <2e-16 ***
## Residuals   91     1601       18                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## List of 1
##  $ :Classes 'anova' and 'data.frame':    2 obs. of  5 variables:
##   ..$ Df     : num [1:2] 1 91
##   ..$ Sum Sq : num [1:2] 15190673 1601
##   ..$ Mean Sq: num [1:2] 1.52e+07 1.76e+01
##   ..$ F value: num [1:2] 863420 NA
##   ..$ Pr(>F) : num [1:2] 9.07e-183 NA
##  - attr(*, "class")= chr [1:2] "summary.aov" "listof"
z <- PlotFunc()
## Call:
##    aov(formula = resVar ~ TGroup, data = ANOdata)
## 
## Terms:
##                   TGroup Residuals
## Sum of Squares  15137743      1702
## Deg. of Freedom        1        91
## 
## Residual standard error: 4.325323
## Estimated effects may be unbalanced
##             Df   Sum Sq  Mean Sq F value Pr(>F)    
## TGroup       1 15137743 15137743  809141 <2e-16 ***
## Residuals   91     1702       19                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## List of 1
##  $ :Classes 'anova' and 'data.frame':    2 obs. of  5 variables:
##   ..$ Df     : num [1:2] 1 91
##   ..$ Sum Sq : num [1:2] 15137743 1702
##   ..$ Mean Sq: num [1:2] 1.51e+07 1.87e+01
##   ..$ F value: num [1:2] 809141 NA
##   ..$ Pr(>F) : num [1:2] 1.74e-181 NA
##  - attr(*, "class")= chr [1:2] "summary.aov" "listof"

Question 2 Functions Changed

source("Homework_9.R")
a <- NewDataFunc()
## 'data.frame':    6000 obs. of  2 variables:
##  $ ID   : int  1 2 3 4 5 6 7 8 9 10 ...
##  $ myVar: num  10.97 11.52 7.06 9.62 11.22 ...
b <- NewSummaryFunc(a)
## 'data.frame':    6000 obs. of  2 variables:
##  $ ID   : int  1 2 3 4 5 6 7 8 9 10 ...
##  $ myVar: num  10.6 10.8 11.5 11 11.1 ...
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   5.859   9.343  10.008  10.009  10.676  13.457
c <- NewANOVAFunc()
## Call:
##    aov(formula = resVar ~ TGroup, data = ANOdata)
## 
## Terms:
##                   TGroup Residuals
## Sum of Squares  15150923      2067
## Deg. of Freedom        1        91
## 
## Residual standard error: 4.766329
## Estimated effects may be unbalanced
##             Df   Sum Sq  Mean Sq F value Pr(>F)    
## TGroup       1 15150923 15150923  666916 <2e-16 ***
## Residuals   91     2067       23                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## List of 1
##  $ :Classes 'anova' and 'data.frame':    2 obs. of  5 variables:
##   ..$ Df     : num [1:2] 1 91
##   ..$ Sum Sq : num [1:2] 15150923 2067
##   ..$ Mean Sq: num [1:2] 1.52e+07 2.27e+01
##   ..$ F value: num [1:2] 666916 NA
##   ..$ Pr(>F) : num [1:2] 1.15e-177 NA
##  - attr(*, "class")= chr [1:2] "summary.aov" "listof"
d <- NewPlotFunc()
## Call:
##    aov(formula = resVar ~ TGroup, data = ANOdata)
## 
## Terms:
##                   TGroup Residuals
## Sum of Squares  15118785      1866
## Deg. of Freedom        1        91
## 
## Residual standard error: 4.528805
## Estimated effects may be unbalanced
##             Df   Sum Sq  Mean Sq F value Pr(>F)    
## TGroup       1 15118785 15118785  737139 <2e-16 ***
## Residuals   91     1866       21                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## List of 1
##  $ :Classes 'anova' and 'data.frame':    2 obs. of  5 variables:
##   ..$ Df     : num [1:2] 1 91
##   ..$ Sum Sq : num [1:2] 15118785 1866
##   ..$ Mean Sq: num [1:2] 1.51e+07 2.05e+01
##   ..$ F value: num [1:2] 737139 NA
##   ..$ Pr(>F) : num [1:2] 1.21e-179 NA
##  - attr(*, "class")= chr [1:2] "summary.aov" "listof"

# hello! I think i fixed