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 <- c(102.42,102.46,102.76,102.4,102.47,102.27,102.17,101.84,102.13,103.34,103.43,103.59,104.21,105.42,105.95,106.28,106.49,106.49,106.49,107.38,108.69,108.76,108.84,108.67,108.79,109.96,110.86,111,111.84,112.21,112.4,113.76,114.85,115.23,115.39,115.29,115.53,116.26,116.85,117.37,118.03,118.49,119.32,119.4,122.26,122.91,123.78,123.99,124.7,125.89,127.57,128.97,130.65,130.73,130.95,131.36,132.85,133.08,133.13,133.27,133.9,134.85,135.49,136.21,136.31,136.22,136.22,135.51,137.3,138.42,138.92,138.67) > par1 = '12' > par1 <- '12' > #'GNU S' R Code compiled by R2WASP v. 1.2.291 () > #Author: root > #To cite this work: Wessa P., (2012), Mean Plot (v1.0.4) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_meanplot.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > # > par1 <- as.numeric(par1) > (n <- length(x)) [1] 72 > (np <- floor(n / par1)) [1] 6 > arr <- array(NA,dim=c(par1,np+1)) > darr <- array(NA,dim=c(par1,np+1)) > ari <- array(0,dim=par1) > dx <- diff(x) > j <- 0 > for (i in 1:n) + { + j = j + 1 + ari[j] = ari[j] + 1 + arr[j,ari[j]] <- x[i] + darr[j,ari[j]] <- dx[i] + if (j == par1) j = 0 + } > ari [1] 6 6 6 6 6 6 6 6 6 6 6 6 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 102.42 104.21 108.79 115.53 124.70 133.90 NA [2,] 102.46 105.42 109.96 116.26 125.89 134.85 NA [3,] 102.76 105.95 110.86 116.85 127.57 135.49 NA [4,] 102.40 106.28 111.00 117.37 128.97 136.21 NA [5,] 102.47 106.49 111.84 118.03 130.65 136.31 NA [6,] 102.27 106.49 112.21 118.49 130.73 136.22 NA [7,] 102.17 106.49 112.40 119.32 130.95 136.22 NA [8,] 101.84 107.38 113.76 119.40 131.36 135.51 NA [9,] 102.13 108.69 114.85 122.26 132.85 137.30 NA [10,] 103.34 108.76 115.23 122.91 133.08 138.42 NA [11,] 103.43 108.84 115.39 123.78 133.13 138.92 NA [12,] 103.59 108.67 115.29 123.99 133.27 138.67 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.04 1.21 1.17 0.73 1.19 0.95 NA [2,] 0.30 0.53 0.90 0.59 1.68 0.64 NA [3,] -0.36 0.33 0.14 0.52 1.40 0.72 NA [4,] 0.07 0.21 0.84 0.66 1.68 0.10 NA [5,] -0.20 0.00 0.37 0.46 0.08 -0.09 NA [6,] -0.10 0.00 0.19 0.83 0.22 0.00 NA [7,] -0.33 0.89 1.36 0.08 0.41 -0.71 NA [8,] 0.29 1.31 1.09 2.86 1.49 1.79 NA [9,] 1.21 0.07 0.38 0.65 0.23 1.12 NA [10,] 0.09 0.08 0.16 0.87 0.05 0.50 NA [11,] 0.16 -0.17 -0.10 0.21 0.14 -0.25 NA [12,] 0.62 0.12 0.24 0.71 0.63 NA NA > arr.mean <- array(NA,dim=par1) > arr.median <- array(NA,dim=par1) > arr.midrange <- array(NA,dim=par1) > for (j in 1:par1) + { + arr.mean[j] <- mean(arr[j,],na.rm=TRUE) + arr.median[j] <- median(arr[j,],na.rm=TRUE) + arr.midrange[j] <- (quantile(arr[j,],0.75,na.rm=TRUE) + quantile(arr[j,],0.25,na.rm=TRUE)) / 2 + } > overall.mean <- mean(x) > overall.median <- median(x) > overall.midrange <- (quantile(x,0.75) + quantile(x,0.25)) / 2 > postscript(file="/var/wessaorg/rcomp/tmp/12qby1362653745.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(arr.mean,type='b',ylab='mean',main='Mean Plot',xlab='Periodic Index') > mtext(paste('#blocks = ',np)) > abline(overall.mean,0) > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/2hrfx1362653745.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(arr.median,type='b',ylab='median',main='Median Plot',xlab='Periodic Index') > mtext(paste('#blocks = ',np)) > abline(overall.median,0) > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/3x9k81362653745.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(arr.midrange,type='b',ylab='midrange',main='Midrange Plot',xlab='Periodic Index') > mtext(paste('#blocks = ',np)) > abline(overall.midrange,0) > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/4vvx51362653745.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > z <- data.frame(t(arr)) > names(z) <- c(1:par1) > (boxplot(z,notch=TRUE,col='grey',xlab='Periodic Index',ylab='Value',main='Notched Box Plots - Periodic Subseries')) $stats [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 102.42 102.46 102.760 102.400 102.470 102.27 102.17 101.84 102.130 103.34 [2,] 104.21 105.42 105.950 106.280 106.490 106.49 106.49 107.38 108.690 108.76 [3,] 112.16 113.11 113.855 114.185 114.935 115.35 115.86 116.58 118.555 119.07 [4,] 124.70 125.89 127.570 128.970 130.650 130.73 130.95 131.36 132.850 133.08 [5,] 133.90 134.85 135.490 136.210 136.310 136.22 136.22 135.51 137.300 138.42 [,11] [,12] [1,] 103.430 103.59 [2,] 108.840 108.67 [3,] 119.585 119.64 [4,] 133.130 133.27 [5,] 138.920 138.67 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 98.94329 99.90619 99.9094 99.54922 99.35102 99.71442 100.0825 [2,] 125.37671 126.31381 127.8006 128.82078 130.51898 130.98558 131.6375 [,8] [,9] [,10] [,11] [,12] [1,] 101.1121 102.971 103.3828 103.9172 103.7722 [2,] 132.0479 134.139 134.7572 135.2528 135.5078 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(102.42, 104.21, 112.16, 124.7, 133.9, 102.46, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/50q671362653745.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > z <- data.frame(t(darr)) > names(z) <- c(1:par1) > (boxplot(z,notch=TRUE,col='grey',xlab='Periodic Index',ylab='Value',main='Notched Box Plots - Differenced Periodic Subseries')) $stats [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [1,] 0.73 0.300 -0.360 0.070 -0.20 -0.100 -0.710 0.29 0.070 0.050 -0.25 0.12 [2,] 0.73 0.530 0.140 0.100 -0.09 0.000 -0.330 1.09 0.230 0.080 -0.17 0.24 [3,] 1.06 0.615 0.425 0.435 0.04 0.095 0.245 1.40 0.515 0.125 0.02 0.62 [4,] 1.19 0.900 0.720 0.840 0.37 0.220 0.890 1.79 1.120 0.500 0.16 0.63 [5,] 1.21 0.900 1.400 1.680 0.46 0.220 1.360 1.79 1.210 0.870 0.21 0.71 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.7632851 0.376338 0.05088127 -0.0423239 -0.2567149 -0.04690711 -0.5419394 [2,] 1.3567149 0.853662 0.79911873 0.9123239 0.3367149 0.23690711 1.0319394 [,8] [,9] [,10] [,11] [,12] [1,] 0.9484774 -0.05907875 -0.1459136 -0.1928607 0.344427 [2,] 1.8515226 1.08907875 0.3959136 0.2328607 0.895573 $out [1] 0.04 1.68 0.83 2.86 $group [1] 1 2 6 8 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(0.730000000000004, 0.730000000000004, 1.05999999999999, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6lmgb1362653745.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > z <- data.frame(arr) > names(z) <- c(1:np) > (boxplot(z,notch=TRUE,col='grey',xlab='Block Index',ylab='Value',main='Notched Box Plots - Sequential Blocks')) $stats [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 101.84 104.210 108.790 115.530 124.700 133.90 NA [2,] 102.22 106.115 110.930 117.110 128.270 135.50 NA [3,] 102.44 106.490 112.305 118.905 130.840 136.22 NA [4,] 103.05 108.680 115.040 122.585 132.965 137.86 NA [5,] 103.59 108.840 115.390 123.990 133.270 138.92 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 102.0614 105.3201 110.4304 116.4078 128.6986 135.1436 NA [2,] 102.8186 107.6599 114.1796 121.4022 132.9814 137.2964 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(101.84, 102.22, 102.44, 103.05, 103.59, 104.21, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/75qfb1362653745.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > z <- data.frame(cbind(arr.mean,arr.median,arr.midrange)) > names(z) <- list('mean','median','midrange') > (boxplot(z,notch=TRUE,col='grey',ylab='Overall Central Tendency',main='Notched Box Plots')) $stats [,1] [,2] [,3] [1,] 114.9250 112.1600 113.8812 [2,] 116.8092 114.0200 116.3994 [3,] 117.8300 115.6050 117.9000 [4,] 119.9850 118.8125 120.3369 [5,] 120.5817 119.6400 120.6375 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 116.3815 113.4191 116.1041 [2,] 119.2785 117.7909 119.6959 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(114.925, 116.809166666667, 117.83, 119.985, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/12qby1362653745.ps tmp/12qby1362653745.png",intern=TRUE)) character(0) > try(system("convert tmp/2hrfx1362653745.ps tmp/2hrfx1362653745.png",intern=TRUE)) character(0) > try(system("convert tmp/3x9k81362653745.ps tmp/3x9k81362653745.png",intern=TRUE)) character(0) > try(system("convert tmp/4vvx51362653745.ps tmp/4vvx51362653745.png",intern=TRUE)) character(0) > try(system("convert tmp/50q671362653745.ps tmp/50q671362653745.png",intern=TRUE)) character(0) > try(system("convert tmp/6lmgb1362653745.ps tmp/6lmgb1362653745.png",intern=TRUE)) character(0) > try(system("convert tmp/75qfb1362653745.ps tmp/75qfb1362653745.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.424 0.613 4.026