paspalum <- read.table("C:/Rexamples/paspalum1data.txt", header=T) View(paspalum) summary(paspalum) attach(paspalum) by(weight, treat, function(x) summary(x)) by(weight, treat, function(x) sd(x)) boxplot(weight~treat) by(weight, treat, function(x) stem(x)) qqnorm(weight[treat=='inocul'], main="Normal Q-Q Plot, inoculated") qqline(weight[treat=='inocul']) shapiro.test(weight[treat=='inocul']) qqnorm(weight[treat=='notinoc'], main="Normal Q-Q Plot, not inoculated") qqline(weight[treat=='notinoc']) shapiro.test(weight[treat=='notinoc']) t.test(weight~treat) t.test(weight~treat, var.equal=TRUE) --------------------- NOTE ------------------------ The first line above which reads the data from the file "paspalum1data.txt" assumes that this file is in the directory "C:/Rexamples". Obey this convention or modify the command. -------------------------- results ---------------------------------- The boxplots and normal probability plots (qqplots) requested in this program will appear in the plot window of RStudio. They can be saved as pdfs or images. I have not posted them here. These plots are somewhat crude since I did not specify titles, labels, or such. The remainder of this file is copied and pasted from the RStudio command window. -------------------------------------------------------- > paspalum <- read.table("C:/Rexamples/paspalum1data.txt", header=T) > View(paspalum) > summary(paspalum) treat weight inocul :12 Min. : 3.900 notinoc:12 1st Qu.: 7.325 Median :11.600 Mean :11.233 3rd Qu.:13.825 Max. :21.800 > attach(paspalum) > by(weight, treat, function(x) summary(x)) treat: inocul Min. 1st Qu. Median Mean 3rd Qu. Max. 3.900 5.125 8.600 8.975 10.650 19.700 ----------------------------------------------- treat: notinoc Min. 1st Qu. Median Mean 3rd Qu. Max. 6.20 11.90 13.35 13.49 15.65 21.80 > by(weight, treat, function(x) sd(x)) treat: inocul [1] 4.638402 ----------------------------------------------- treat: notinoc [1] 4.022993 > boxplot(weight~treat) > the boxplots appear in the plot window of RStudio ***************** > by(weight, treat, function(x) stem(x)) The decimal point is 1 digit(s) to the right of the | 0 | 44 0 | 5578 1 | 00024 1 | 2 | 0 The decimal point is 1 digit(s) to the right of the | 0 | 69 1 | 12234 1 | 5567 2 | 2 treat: inocul NULL ----------------------------------------------- treat: notinoc NULL > qqnorm(weight[treat=='inocul'], main="Normal Q-Q Plot, inoculated") > qqline(weight[treat=='inocul']) > shapiro.test(weight[treat=='inocul']) Shapiro-Wilk normality test data: weight[treat == "inocul"] W = 0.9057, p-value = 0.1879 > the normal probability plot appears in the plot window of RStudio ***************** > qqnorm(weight[treat=='notinoc'], main="Normal Q-Q Plot, not inoculated") > qqline(weight[treat=='notinoc']) > shapiro.test(weight[treat=='notinoc']) Shapiro-Wilk normality test data: weight[treat == "notinoc"] W = 0.9778, p-value = 0.9735 > the normal probability plot appears in the plot window of RStudio ***************** > t.test(weight~treat) Welch Two Sample t-test data: weight by treat t = -2.5483, df = 21.569, p-value = 0.01849 alternative hypothesis: true difference in means is not equal to 0 95 percent confidence interval: -8.1967826 -0.8365507 sample estimates: mean in group inocul mean in group notinoc 8.97500 13.49167 > t.test(weight~treat, var.equal=TRUE) Two Sample t-test data: weight by treat t = -2.5483, df = 22, p-value = 0.01832 alternative hypothesis: true difference in means is not equal to 0 95 percent confidence interval: -8.192517 -0.840816 sample estimates: mean in group inocul mean in group notinoc 8.97500 13.49167 > >