# tTestPairedSoTL.R # paired t test for SoTL # Import Data From Spreadsheet (Step 1) # ------------------------------------- # Data: 2 columns of numeric data, blank cells are ok, but no cells with words. df = read.table(file = "clipboard", sep = "\t", header = TRUE); df; # display student data in console. # Clean data in R (remove the rows with NA's)(Step 2) # ---------------------------------------------------- dfc = na.omit(df) # dfc = df with rows with blank cells removed dfc # Find the mean and standard deviation of the quiz scores (Step 3) # ---------------------------------------------------------------- mean(dfc$before); # the mean of the before scores sd(dfc$before); # the standard deviation of the before scores mean(dfc$after); # the mean of the after scores sd(dfc$after); # the standard deviation of the after scores # Create histogram of data (Step 4) # -------------------------------- hist(dfc$after - dfc$before, main = "Histogram of quiz score differences\nPost-treatment minus pre-treatment", xlab = "Percent", col = "green" ); # Do the paired t-test (Step 5) # ----------------------------- t.test(dfc$after - dfc$before, alternative = "greater", mu = 0); # End of Script #---------------------------------------------