R version 2.15.2 (2012-10-26) -- "Trick or Treat" Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i686-pc-linux-gnu (32-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > x <- array(list(1,88,2,94,2,90,2,73,1,68,2,80,2,86,3,86,3,91,1,79,3,96,2,92,3,72,2,96,1,70,2,86,2,87,3,88,2,79,1,90,2,95,2,85,2,90,3,115,3,84,2,79,1,94,2,97,2,86,3,111,2,87,3,98,3,87,1,68,1,88,3,82,3,111,2,75,1,94,1,95,1,80,2,95,2,68,1,94,1,88,3,84,1,101,2,98,3,78,2,109,2,102,1,81,3,97,3,75,2,97,1,101,3,101,2,95,2,95,2,95,1,90,2,107,3,92,2,86,1,70,3,95,1,96,2,91,3,87,1,92,3,97,2,102,1,91,2,68,1,88,2,97,2,90,3,101,3,94,3,101,3,109,2,100,2,103,2,94,3,97,1,85,1,75,2,77,1,87,3,78,2,108,2,97,2,106,2,107,2,95,3,107,2,115,2,101,3,85,3,90,3,115,2,95,2,97,1,112,3,97,2,77,2,90,2,94,2,103,2,77,1,98,2,90,2,111,1,77,1,88,2,75,3,92,1,78,3,106,1,80,2,87,2,92,1,86,3,85,2,90,3,101,2,94,2,86,3,86,2,90,3,75,2,86,1,91,2,97,1,91,1,70,1,98,1,96,2,95,2,100,2,95,1,97,3,97,3,92,3,115,2,88,1,87,2,100,3,98,2,102,1,96),dim=c(2,151),dimnames=list(c('MWARM30','WISCRY7V '),1:151)) > y <- array(NA,dim=c(2,151),dimnames=list(c('MWARM30','WISCRY7V '),1:151)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > par3 = 'TRUE' > par2 = '2' > par1 = '1' > ylab = 'Y Variable Name' > xlab = 'X Variable Name' > main = 'Title Goes Here' > par3 <- 'TRUE' > par2 <- '2' > par1 <- '1' > cat1 <- as.numeric(par1) # > cat2<- as.numeric(par2) # > intercept<-as.logical(par3) > x <- t(x) > x1<-as.numeric(x[,cat1]) > f1<-as.character(x[,cat2]) > xdf<-data.frame(x1,f1) > (V1<-dimnames(y)[[1]][cat1]) [1] "MWARM30" > (V2<-dimnames(y)[[1]][cat2]) [1] "WISCRY7V\r\r\r" > names(xdf)<-c('Response', 'Treatment') > if(intercept == FALSE) (lmxdf<-lm(Response ~ Treatment - 1, data = xdf) ) else (lmxdf<-lm(Response ~ Treatment, data = xdf) ) Call: lm(formula = Response ~ Treatment, data = xdf) Coefficients: (Intercept) Treatment101 Treatment102 Treatment103 Treatment106 2.000e+00 2.857e-01 2.241e-16 2.005e-16 5.000e-01 Treatment107 Treatment108 Treatment109 Treatment111 Treatment112 3.333e-01 1.915e-16 5.000e-01 6.667e-01 -1.000e+00 Treatment115 Treatment68 Treatment70 Treatment72 Treatment73 7.500e-01 -5.000e-01 -1.000e+00 1.000e+00 2.777e-16 Treatment75 Treatment77 Treatment78 Treatment79 Treatment80 2.000e-01 -2.500e-01 3.333e-01 -3.333e-01 -6.667e-01 Treatment81 Treatment82 Treatment84 Treatment85 Treatment86 -1.000e+00 1.000e+00 1.000e+00 2.500e-01 1.111e-01 Treatment87 Treatment88 Treatment90 Treatment91 Treatment92 2.180e-16 -5.714e-01 -1.000e-01 -4.000e-01 3.333e-01 Treatment94 Treatment95 Treatment96 Treatment97 Treatment98 -2.500e-01 1.899e-16 -4.000e-01 3.333e-01 3.432e-16 > (aov.xdf<-aov(lmxdf) ) Call: aov(formula = lmxdf) Terms: Treatment Residuals Sum of Squares 24.75843 57.21508 Deg. of Freedom 34 116 Residual standard error: 0.7023058 Estimated effects may be unbalanced > (anova.xdf<-anova(lmxdf) ) Analysis of Variance Table Response: Response Df Sum Sq Mean Sq F value Pr(>F) Treatment 34 24.758 0.72819 1.4764 0.0661 . Residuals 116 57.215 0.49323 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 > > #Note: the /var/fisher/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/fisher/rcomp/createtable") > > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,'ANOVA Model', length(lmxdf$coefficients)+1,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, paste(V1, ' ~ ', V2), length(lmxdf$coefficients)+1,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'means',,TRUE) > for(i in 1:length(lmxdf$coefficients)){ + a<-table.element(a, round(lmxdf$coefficients[i], digits=3),,FALSE) + } > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/fisher/rcomp/tmp/1m58i1352163959.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,'ANOVA Statistics', 5+1,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, ' ',,TRUE) > a<-table.element(a, 'Df',,FALSE) > a<-table.element(a, 'Sum Sq',,FALSE) > a<-table.element(a, 'Mean Sq',,FALSE) > a<-table.element(a, 'F value',,FALSE) > a<-table.element(a, 'Pr(>F)',,FALSE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, V2,,TRUE) > a<-table.element(a, anova.xdf$Df[1],,FALSE) > a<-table.element(a, round(anova.xdf$'Sum Sq'[1], digits=3),,FALSE) > a<-table.element(a, round(anova.xdf$'Mean Sq'[1], digits=3),,FALSE) > a<-table.element(a, round(anova.xdf$'F value'[1], digits=3),,FALSE) > a<-table.element(a, round(anova.xdf$'Pr(>F)'[1], digits=3),,FALSE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Residuals',,TRUE) > a<-table.element(a, anova.xdf$Df[2],,FALSE) > a<-table.element(a, round(anova.xdf$'Sum Sq'[2], digits=3),,FALSE) > a<-table.element(a, round(anova.xdf$'Mean Sq'[2], digits=3),,FALSE) > a<-table.element(a, ' ',,FALSE) > a<-table.element(a, ' ',,FALSE) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/fisher/rcomp/tmp/28f4a1352163959.tab") > postscript(file="/var/fisher/rcomp/tmp/3sokl1352163959.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > boxplot(Response ~ Treatment, data=xdf, xlab=V2, ylab=V1) Warning messages: 1: In title(xlab = "WISCRY7V\r\r\r", ylab = "MWARM30") : font width unknown for character 0xd 2: In title(xlab = "WISCRY7V\r\r\r", ylab = "MWARM30") : font width unknown for character 0xd 3: In title(xlab = "WISCRY7V\r\r\r", ylab = "MWARM30") : font width unknown for character 0xd > dev.off() null device 1 > if(intercept==TRUE){ + 'Tukey Plot' + thsd<-TukeyHSD(aov.xdf) + postscript(file="/var/fisher/rcomp/tmp/4dkdd1352163959.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) + plot(thsd) + dev.off() + } null device 1 > if(intercept==TRUE){ + a<-table.start() + a<-table.row.start(a) + a<-table.element(a,'Tukey Honest Significant Difference Comparisons', 5,TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a, ' ', 1, TRUE) + for(i in 1:4){ + a<-table.element(a,colnames(thsd[[1]])[i], 1, TRUE) + } + a<-table.row.end(a) + for(i in 1:length(rownames(thsd[[1]]))){ + a<-table.row.start(a) + a<-table.element(a,rownames(thsd[[1]])[i], 1, TRUE) + for(j in 1:4){ + a<-table.element(a,round(thsd[[1]][i,j], digits=3), 1, FALSE) + } + a<-table.row.end(a) + } + a<-table.end(a) + table.save(a,file="/var/fisher/rcomp/tmp/5tdt21352163959.tab") + } > if(intercept==FALSE){ + a<-table.start() + a<-table.row.start(a) + a<-table.element(a,'TukeyHSD Message', 1,TRUE) + a<-table.row.end(a) + a<-table.start() + a<-table.row.start(a) + a<-table.element(a,'Must Include Intercept to use Tukey Test ', 1, FALSE) + a<-table.row.end(a) + a<-table.end(a) + table.save(a,file="/var/fisher/rcomp/tmp/66rab1352163959.tab") + } > library(car) Loading required package: MASS Loading required package: nnet > lt.lmxdf<-leveneTest(lmxdf) > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,'Levenes Test for Homogeneity of Variance', 4,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,' ', 1, TRUE) > for (i in 1:3){ + a<-table.element(a,names(lt.lmxdf)[i], 1, FALSE) + } > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Group', 1, TRUE) > for (i in 1:3){ + a<-table.element(a,round(lt.lmxdf[[i]][1], digits=3), 1, FALSE) + } > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,' ', 1, TRUE) > a<-table.element(a,lt.lmxdf[[1]][2], 1, FALSE) > a<-table.element(a,' ', 1, FALSE) > a<-table.element(a,' ', 1, FALSE) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/fisher/rcomp/tmp/7g47s1352163959.tab") > > try(system("convert tmp/3sokl1352163959.ps tmp/3sokl1352163959.png",intern=TRUE)) character(0) > try(system("convert tmp/4dkdd1352163959.ps tmp/4dkdd1352163959.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 9.837 0.380 10.203