------------------------------------------------------ -- Comparing Two Sample Sets -- -- Load ds1 with your first sample set -- rawData<-read.table("/Users/cshallah/Desktop/11g_St.txt",header=FALSE) attach(rawData) ds1<-V1 dends1<-density(ds1) -- Do Basic Analysis on sample set one, ds1 -- set ds and run the "Learn about your data" steps in the prior section ds<-ds1 fivenum(ds) summary(ds) sd(ds) shapiro.test(ds) hist(ds) plot(density(ds)) -- -- Load ds2 with your second sample set -- rawData<-read.table("/Users/cshallah/Desktop/12c_St.txt",header=FALSE) attach(rawData) ds2<-V1 dends2<-density(ds2) -- Do basic analysis on sample set two, ds2 -- set ds and run the "Learn about your data" steps in the prior section ds<-ds2 fivenum(ds) summary(ds) sd(ds) shapiro.test(ds) hist(ds) plot(density(ds)) -- Now compare the two sample sets -- If p > 0.05 the sets likely came from the same population. -- -- First, T Test. Both data sets be normal for valid T Test. t.test(ds1,ds2) -- Second, if one or both of the data sets are not normal, a location equivalence test is required... no problem... wilcox.test(ds1,ds2) -- Let's visually look at both data sets. -- copy/paste the below three lines plot(range(dends1$x, dends2$x), range(dends1$y, dends2$y), type = "n", xlab = "Sample Values", ylab = "Probability", main="Probability Density Curve\n11g:red, 12c:blue") lines(dends1, col = "red") lines(dends2, col = "blue") quit()