Loading the data into R

These data are available at https://github.com/ncooper76/MSDA/blob/master/GradeComparison2.csv Be sure to change the Directory to your local directory with the code below

grades <- read.csv("C:/Users/Nate/Documents/DataSet/GradeComparison2.csv")

Attaching data

You can use the attach command so you can use colName instead of data$colName syntax. You need to detach before you use another data set

attach(grades)
names(grades)
## [1] "ï..Student" "N_count"    "A_count"

Getting rid of NA’s

Since one teacher teaches more students than the other on colunm has NA’s use this code to git rid of them.

A_count =A_count[!is.na(A_count)]
A_count
##  [1] 95 94 93 93 93 93 92 92 92 92 91 90 88 88 88 87 87 87 85 84 84 84 84
## [24] 84 82 82 82 81 80 79 79 78 75 75 71 70 64 63 60

Analyzing the data

Student’s t-test will tell you if two samples are drawn from different populations. It assumes that both samples have the same varience and are normally distributed. Conventionally 95% is set as the cutoff for statistical significance, so p has to be <0.05.

var.test(N_count,A_count)
## 
##  F test to compare two variances
## 
## data:  N_count and A_count
## F = 0.76403, num df = 51, denom df = 38, p-value = 0.3669
## alternative hypothesis: true ratio of variances is not equal to 1
## 95 percent confidence interval:
##  0.4129363 1.3763840
## sample estimates:
## ratio of variances 
##          0.7640326
t.test(N_count, A_count, var.equal=TRUE)
## 
##  Two Sample t-test
## 
## data:  N_count and A_count
## t = -1.6965, df = 89, p-value = 0.09329
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -6.4719898  0.5104513
## sample estimates:
## mean of x mean of y 
##  80.63462  83.61538