You typically use paired T Tests when you have parametric data that is comparing data that has been collected at two different times, with something happening between those two points. In Social Work research that often means we are doing an intervention that we want to test. In this case, we are using the UMKC School of Social Work Research class. We gave a pretest the first day of class and a post-test after all coursework was completed. So here i compare the scores

First read the data into R

Ttest <-read.delim("/Volumes/Mirror Mirror /Google Drive/Research_UMKC/SE4SW.FE/T_Tests/prepost.txt")

Next test to see if the data is normally distributed:

to do this we use the Shapiro Test
pre<-shapiro.test(Ttest$PRE)
post<-shapiro.test(Ttest$POST)
pre
## 
## 	Shapiro-Wilk normality test
## 
## data:  Ttest$PRE
## W = 0.98146, p-value = 0.7179
post
## 
## 	Shapiro-Wilk normality test
## 
## data:  Ttest$POST
## W = 0.92363, p-value = 0.007946

OH NO! While the 'pre' score is good on the Shapiro Test (greater than .05 on the p-value), the 'POST' value is significant at .008. Decision time (do both is the best answer), but a lot of times you will see people report their findings without any sort of an understanding if there was test for normality done first.

Let's soldier on....

Paired T Test

So even though we saw the Shapiro test on the POST data was not normally distributed, we are going to go ahead and use the T Test anyway. Then we will do a Wilcoxon Signed Rank Test to confirm our findings.

Box Plots

Crafting Box Plots in R is not difficult:

boxplot(Ttest$PRE,Ttest$POST, names=c('pre-test','post-test'),
        main='Boxplots comparing scores on Pre-test vs Post-test',
        col=c('blue','yellow'))
plot of chunk unnamed-chunk-4

IF your data is nonparametric, you should go to the Wilcoxon test

Wilcoxon Signed Rank Test