Send output to:
Browser Blue - Charts White
Browser Black/White
CSV
Data X:
1 4512 1 1 3738 1 1 4261 1 1 3777 1 1 4177 1 1 3585 1 1 3785 1 1 3559 1 1 3613 1 1 3982 1 1 3443 1 1 3993 1 1 3640 1 1 4208 1 1 3832 1 1 3876 1 1 3497 1 1 3466 1 1 3095 1 1 4424 1 1 3878 1 1 4046 1 1 3804 1 1 3710 1 1 4747 1 1 4423 1 1 4036 1 1 4022 1 1 3454 1 1 4175 1 1 3787 1 1 3796 1 1 4103 1 1 4161 1 1 4158 1 1 3814 1 1 3527 1 1 3748 1 1 3334 1 1 3492 1 1 3962 1 1 3505 1 1 4315 1 1 3804 1 1 3863 1 1 4034 1 1 4308 1 1 3165 1 1 3641 1 1 3644 1 1 3891 1 1 3793 1 1 4270 1 1 4063 1 1 4012 1 1 3458 1 1 3890 1 2 4166 1 2 3935 1 2 3669 1 2 3866 1 2 3393 1 2 4442 1 2 4253 1 2 3727 1 2 3329 1 2 3415 1 2 3372 1 2 4430 1 2 4381 1 2 4008 1 2 3858 1 2 4121 1 2 4057 1 2 3824 1 2 3394 1 2 3558 1 2 3362 1 2 3930 1 2 3835 1 2 3830 1 2 3856 1 2 3249 1 2 3577 1 2 3933 1 2 3850 1 2 3309 1 2 3406 1 2 3506 1 2 3907 1 2 4160 1 2 3318 1 2 3662 1 2 3899 1 2 3700 1 2 3779 1 2 3473 1 2 3490 1 2 3654 1 2 3478 1 2 3495 1 2 3834 1 2 3876 1 2 3661 1 2 3618 1 2 3648 1 2 4032 1 2 3399 1 2 3916 1 2 4430 1 2 3695 1 2 3524 1 2 3571 1 2 3594 1 2 3383 1 2 3499 1 2 3589 1 2 3900 1 2 4114 1 2 3937 1 2 3399 1 2 4200 1 2 4488 1 2 3614 1 2 4051 1 2 3782 1 2 3391 1 2 3124 1 2 4053 1 2 3582 1 2 3666 1 2 3532 1 2 4046 1 2 3667 1 1 2857 2 1 3436 2 1 3791 2 1 3302 2 1 3104 2 1 3171 2 1 3572 2 1 3530 2 1 3175 2 1 3438 2 1 3903 2 1 3899 2 1 3401 2 1 3267 2 1 3451 2 1 3090 2 1 3413 2 1 3323 2 1 3680 2 1 3439 2 1 3853 2 1 3156 2 1 3279 2 1 3707 2 1 4006 2 1 3269 2 1 3071 2 1 3779 2 1 3548 2 1 3292 2 1 3497 2 1 3082 2 1 3248 2 1 3358 2 1 3803 2 1 3566 2 1 3145 2 1 3503 2 1 3571 2 1 3724 2 1 3615 2 1 3203 2 1 3609 2 1 3561 2 1 3979 2 1 3533 2 1 3689 2 1 3158 2 1 4005 2 1 3181 2 1 3479 2 1 3642 2 1 3632 2 2 3069 2 2 3394 2 2 3703 2 2 3165 2 2 3354 2 2 3000 2 2 3687 2 2 3556 2 2 2773 2 2 3058 2 2 3344 2 2 3493 2 2 3297 2 2 3360 2 2 3228 2 2 3277 2 2 3851 2 2 3067 2 2 3692 2 2 3402 2 2 3995 2 2 3318 2 2 2720 2 2 2937 2 2 3580 2 2 2939 2 2 2989 2 2 3586 2 2 3156 2 2 3246 2 2 3170 2 2 3268 2 2 3389 2 2 3381 2 2 2864 2 2 3740 2 2 3479 2 2 3647 2 2 3716 2 2 3284 2 2 4204 2 2 3735 2 2 3218 2 2 3685 2 2 3704 2 2 3214 2 2 3394 2 2 3233 2 2 3352 2 2 3391 2
Names of X columns:
Age Head_size Gender
Response : Variable 1
Factor : Variable 2
Factor : Variable 3
Include Intercept Term ?
TRUE
TRUE
FALSE
Chart options
Title:
Label y-axis:
Label x-axis:
R Code
par4 <- 'FALSE' par3 <- '3' par2 <- '1' par1 <- '2' 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