#Example 2 # Testing hypothesis about two related population means #paired samples #Set working directory setwd("~/Dropbox/ISI SCB/Data sets") # read in csv file sk <-read.csv("skills.csv", TRUE) #assign the list of scores to the variable x #for "Post-training' test x <- sk$After.Score #assign the list of reading scores to the variable y #for "Pre-training' test y <- sk$Before.Score #D= Post-training - Pre-training #H0: muD = 0 , H1: muD > 0 #t-test t.test(x,y, alternative="greater", paired = TRUE) # this will enable us to get a 95% two-sided confidence iterval #H0: muD = 0 , H1: muD not= 0 t.test(x,y, alternative="two.sided", paired = TRUE) # difference between post-training and pre-training scores d <- y-x #check for outliers boxplot(d) #assess normality assumptions of x and y qqnorm(d, ylab = "d Sample Quantiles") shapiro.test(x)