R version 2.15.1 (2012-06-22) -- "Roasted Marshmallows" 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(246.24,247.57,247.84,248.27,248.3,248.31,248.31,248.38,248.37,248.41,248.68,248.75,248.75,247.95,248.13,247.86,246.23,245.98,245.98,246.27,246.31,246.3,246.67,246.78,246.78,247.91,247.99,248.6,248.68,248.75,248.75,249.03,249.05,249.57,249.35,249.46,249.46,250.82,254.19,255.18,256.68,256.73,256.73,257.39,257.78,258.67,258.71,258.91,258.91,261.38,262.42,262.77,263.24,262.83,262.83,263.09,263.6,265.68,266.08,266.28,266.28,269.14,270.96,272.97,273.13,274.73,274.73,274.59,275.15,275.16,275.38,275.4) > 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,] 246.24 248.75 246.78 249.46 258.91 266.28 NA [2,] 247.57 247.95 247.91 250.82 261.38 269.14 NA [3,] 247.84 248.13 247.99 254.19 262.42 270.96 NA [4,] 248.27 247.86 248.60 255.18 262.77 272.97 NA [5,] 248.30 246.23 248.68 256.68 263.24 273.13 NA [6,] 248.31 245.98 248.75 256.73 262.83 274.73 NA [7,] 248.31 245.98 248.75 256.73 262.83 274.73 NA [8,] 248.38 246.27 249.03 257.39 263.09 274.59 NA [9,] 248.37 246.31 249.05 257.78 263.60 275.15 NA [10,] 248.41 246.30 249.57 258.67 265.68 275.16 NA [11,] 248.68 246.67 249.35 258.71 266.08 275.38 NA [12,] 248.75 246.78 249.46 258.91 266.28 275.40 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 1.33 -0.80 1.13 1.36 2.47 2.86 NA [2,] 0.27 0.18 0.08 3.37 1.04 1.82 NA [3,] 0.43 -0.27 0.61 0.99 0.35 2.01 NA [4,] 0.03 -1.63 0.08 1.50 0.47 0.16 NA [5,] 0.01 -0.25 0.07 0.05 -0.41 1.60 NA [6,] 0.00 0.00 0.00 0.00 0.00 0.00 NA [7,] 0.07 0.29 0.28 0.66 0.26 -0.14 NA [8,] -0.01 0.04 0.02 0.39 0.51 0.56 NA [9,] 0.04 -0.01 0.52 0.89 2.08 0.01 NA [10,] 0.27 0.37 -0.22 0.04 0.40 0.22 NA [11,] 0.07 0.11 0.11 0.20 0.20 0.02 NA [12,] 0.00 0.00 0.00 0.00 0.00 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/1q7jj1350842299.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/2trv91350842299.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/3w83x1350842299.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/4hlg21350842299.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,] 246.240 247.570 247.84 247.86 246.23 245.98 245.98 246.27 246.310 246.30 [2,] 246.780 247.910 247.99 248.27 248.30 248.31 248.31 248.38 248.370 248.41 [3,] 249.105 249.385 251.16 251.89 252.68 252.74 252.74 253.21 253.415 254.12 [4,] 258.910 261.380 262.42 262.77 263.24 262.83 262.83 263.09 263.600 265.68 [5,] 266.280 269.140 270.96 272.97 273.13 274.73 274.73 274.59 275.150 275.16 [,11] [,12] [1,] 246.67 246.780 [2,] 248.68 248.750 [3,] 254.03 254.185 [4,] 266.08 266.280 [5,] 275.38 275.400 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 241.2808 240.6964 241.8522 242.537 243.0432 243.3741 243.3741 243.7216 [2,] 256.9292 258.0736 260.4678 261.243 262.3168 262.1059 262.1059 262.6984 [,9] [,10] [,11] [,12] [1,] 243.5912 242.9803 242.8064 242.8776 [2,] 263.2388 265.2597 265.2536 265.4924 $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(246.24, 246.78, 249.105, 258.91, 266.28, 247.57, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5rwqj1350842299.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.800 0.080 -0.27 0.03 -0.41 0 -0.14 -0.010 -0.01 -0.220 0.02 0 [2,] 1.130 0.180 0.35 0.03 -0.25 0 0.07 0.020 0.01 0.040 0.07 0 [3,] 1.345 0.655 0.52 0.12 0.03 0 0.27 0.215 0.28 0.245 0.11 0 [4,] 2.470 1.820 0.99 0.47 0.07 0 0.29 0.510 0.89 0.370 0.20 0 [5,] 2.860 3.370 0.99 0.47 0.07 0 0.29 0.560 2.08 0.400 0.20 0 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.4806567 -0.402853 0.1071793 -0.1638142 -0.1764103 0 0.1280929 [2,] 2.2093433 1.712853 0.9328207 0.4038142 0.2364103 0 0.4119071 [,8] [,9] [,10] [,11] [,12] [1,] -0.1010658 -0.2876284 0.03213934 0.0261458 0 [2,] 0.5310658 0.8476284 0.45786066 0.1938542 0 $out [1] 2.01 -1.63 1.50 1.60 0.66 $group [1] 3 4 4 5 7 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.800000000000011, 1.13, 1.34499999999998, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6n5or1350842299.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,] 247.570 245.980 247.910 249.460 261.380 269.140 NA [2,] 248.055 246.250 248.295 254.685 262.595 271.965 NA [3,] 248.310 246.490 248.750 256.730 262.960 274.660 NA [4,] 248.395 247.905 249.200 258.225 264.640 275.155 NA [5,] 248.750 248.750 249.570 258.910 266.280 275.400 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 248.1549 245.7351 248.3372 255.1154 262.0273 273.205 NA [2,] 248.4651 247.2449 249.1628 258.3446 263.8927 276.115 NA $out [1] 246.24 246.78 258.91 266.28 $group [1] 1 3 5 6 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(247.57, 248.055, 248.31, 248.395, 248.75, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7jppv1350842299.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,] 254.1283 249.1050 253.3300 [2,] 255.5983 251.5250 254.4031 [3,] 256.2217 252.7400 254.9300 [4,] 257.0042 253.7225 255.8281 [5,] 257.5967 254.1850 256.6825 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 255.5805 251.7377 254.28 [2,] 256.8629 253.7423 255.58 $out [1] 252.7367 251.9100 $group [1] 1 3 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(254.128333333333, 255.598333333333, 256.221666666667, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1q7jj1350842299.ps tmp/1q7jj1350842299.png",intern=TRUE)) character(0) > try(system("convert tmp/2trv91350842299.ps tmp/2trv91350842299.png",intern=TRUE)) character(0) > try(system("convert tmp/3w83x1350842299.ps tmp/3w83x1350842299.png",intern=TRUE)) character(0) > try(system("convert tmp/4hlg21350842299.ps tmp/4hlg21350842299.png",intern=TRUE)) character(0) > try(system("convert tmp/5rwqj1350842299.ps tmp/5rwqj1350842299.png",intern=TRUE)) character(0) > try(system("convert tmp/6n5or1350842299.ps tmp/6n5or1350842299.png",intern=TRUE)) character(0) > try(system("convert tmp/7jppv1350842299.ps tmp/7jppv1350842299.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.366 0.734 4.086