Send output to:
Browser Blue - Charts White
Browser Black/White
CSV
Data X:
1 50 50 1 50 50 1 50 55 1 50 50 1 50 47 1 50 49 1 51 52 1 51 50 1 51 51 1 52 57 1 52 52 1 52 51 1 52 52 1 52 51 1 52 56 1 52 53 1 53 54 1 53 52 1 53 53 1 53 51 1 53 53 1 53 55 1 53 52 1 53 50 1 54 59 1 54 53 1 54 55 1 54 56 1 54 55 1 54 54 2 54 58 1 55 54 1 55 55 1 55 57 1 55 55 1 55 55 1 55 55 2 55 56 1 56 54 1 56 57 1 56 57 1 56 56 1 56 56 1 56 57 1 56 53 1 56 56 2 56 58 1 57 59 1 57 56 1 57 55 1 57 58 1 57 56 2 57 58 1 58 51 1 58 60 1 58 54 1 59 59 1 59 55 1 59 55 1 59 58 1 59 59 1 59 59 2 59 61 1 60 59 1 60 55 1 60 55 1 61 61 1 61 61 1 61 60 2 61 61 1 62 62 1 62 61 1 62 63 1 62 62 1 62 61 1 62 61 2 62 66 2 62 64 1 63 61 1 63 59 1 63 64 1 63 62 1 63 59 2 63 63 1 64 64 1 64 63 1 64 62 1 64 64 1 64 62 1 64 66 2 64 65 1 65 66 2 65 64 2 65 66 2 65 67 2 65 64 2 65 66 1 66 65 1 66 66 2 66 70 2 66 66 2 66 68 2 66 67 2 67 67 1 68 63 1 68 68 1 68 68 2 68 70 2 68 69 2 68 68 2 69 73 2 69 69 2 69 70 2 69 70 2 69 71 2 69 73 2 69 68 1 70 67 2 70 75 2 70 68 2 70 70 1 71 71 2 71 71 2 71 71 2 71 76 2 71 68 2 73 74 2 74 73 2 74 71 1 75 75 2 75 73 2 75 70 2 75 76 1 76 77 2 76 76 2 76 77 2 76 75 2 76 75 2 76 75 2 77 77 1 78 75 2 78 80 2 78 77 2 79 76 2 79 79 2 79 81 2 80 80 2 80 76 2 80 78 2 81 82 2 82 85 2 83 83 2 83 84 2 83 80 2 84 86 2 84 90 2 85 82 2 85 83 2 87 89 2 88 86 2 88 87 2 88 86 2 88 93 2 89 86 2 90 91
Names of X columns:
Gender Weight Reweight
Response : Variable 1
Factor : Variable 2
Factor : Variable 3
Include Intercept Term ?
TRUE
FALSE
Chart options
Title:
Label y-axis:
Label x-axis:
R Code
par4 <- 'FALSE' par3 <- '' par2 <- '' par1 <- '' cat1 <- as.numeric(par1) # cat2<- as.numeric(par2) # cat3 <- as.numeric(par3) intercept<-as.logical(par4) x <- t(x) x1<-as.numeric(x[,cat1]) f1<-as.character(x[,cat2]) f2 <- as.character(x[,cat3]) xdf<-data.frame(x1,f1, f2) (V1<-dimnames(y)[[1]][cat1]) (V2<-dimnames(y)[[1]][cat2]) (V3 <-dimnames(y)[[1]][cat3]) names(xdf)<-c('Response', 'Treatment_A', 'Treatment_B') if(intercept == FALSE) (lmxdf<-lm(Response ~ Treatment_A * Treatment_B- 1, data = xdf) ) else (lmxdf<-lm(Response ~ Treatment_A * Treatment_B, data = xdf) ) (aov.xdf<-aov(lmxdf) ) (anova.xdf<-anova(lmxdf) ) load(file='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, lmxdf$call['formula'],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='mytable.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) for(i in 1 : length(rownames(anova.xdf))-1){ a<-table.row.start(a) a<-table.element(a,rownames(anova.xdf)[i] ,,TRUE) a<-table.element(a, anova.xdf$Df[1],,FALSE) a<-table.element(a, round(anova.xdf$'Sum Sq'[i], digits=3),,FALSE) a<-table.element(a, round(anova.xdf$'Mean Sq'[i], digits=3),,FALSE) a<-table.element(a, round(anova.xdf$'F value'[i], digits=3),,FALSE) a<-table.element(a, round(anova.xdf$'Pr(>F)'[i], 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'[i+1],,FALSE) a<-table.element(a, round(anova.xdf$'Sum Sq'[i+1], digits=3),,FALSE) a<-table.element(a, round(anova.xdf$'Mean Sq'[i+1], 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='mytable1.tab') bitmap(file='anovaplot.png') boxplot(Response ~ Treatment_A + Treatment_B, data=xdf, xlab=V2, ylab=V1, main='Boxplots of ANOVA Groups') dev.off() bitmap(file='designplot.png') xdf2 <- xdf # to preserve xdf make copy for function names(xdf2) <- c(V1, V2, V3) plot.design(xdf2, main='Design Plot of Group Means') dev.off() bitmap(file='interactionplot.png') interaction.plot(xdf$Treatment_A, xdf$Treatment_B, xdf$Response, xlab=V2, ylab=V1, trace.label=V3, main='Possible Interactions Between Anova Groups') dev.off() if(intercept==TRUE){ thsd<-TukeyHSD(aov.xdf) names(thsd) <- c(V2, V3, paste(V2, ':', V3, sep='')) bitmap(file='TukeyHSDPlot.png') layout(matrix(c(1,2,3,3), 2,2)) plot(thsd, las=1) dev.off() } if(intercept==TRUE){ ntables<-length(names(thsd)) 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(nt in 1:ntables){ for(i in 1:length(rownames(thsd[[nt]]))){ a<-table.row.start(a) a<-table.element(a,rownames(thsd[[nt]])[i], 1, TRUE) for(j in 1:4){ a<-table.element(a,round(thsd[[nt]][i,j], digits=3), 1, FALSE) } a<-table.row.end(a) } } # end nt a<-table.end(a) table.save(a,file='hsdtable.tab') }#end if hsd tables 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='mytable2.tab') } library(car) lt.lmxdf<-levene.test(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='mytable3.tab')
Compute
Summary of computational transaction
Raw Input
view raw input (R code)
Raw Output
view raw output of R engine
Computing time
0 seconds
R Server
Big Analytics Cloud Computing Center
Click here to blog (archive) this computation