R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" Copyright (C) 2013 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-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.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,275.4,275.71,275.21,279.04,279.1,279.11,279.11,279.02,279.3,279.34,279.36,279.39,279.39,280.21,283,284.33,285.15,284.21,284.21,284.17,286.28,286.95,287.12,287.34) > 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.78 249.46 258.91 266.28 275.40 279.39 NA [2,] 247.91 250.82 261.38 269.14 275.71 280.21 NA [3,] 247.99 254.19 262.42 270.96 275.21 283.00 NA [4,] 248.60 255.18 262.77 272.97 279.04 284.33 NA [5,] 248.68 256.68 263.24 273.13 279.10 285.15 NA [6,] 248.75 256.73 262.83 274.73 279.11 284.21 NA [7,] 248.75 256.73 262.83 274.73 279.11 284.21 NA [8,] 249.03 257.39 263.09 274.59 279.02 284.17 NA [9,] 249.05 257.78 263.60 275.15 279.30 286.28 NA [10,] 249.57 258.67 265.68 275.16 279.34 286.95 NA [11,] 249.35 258.71 266.08 275.38 279.36 287.12 NA [12,] 249.46 258.91 266.28 275.40 279.39 287.34 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 1.13 1.36 2.47 2.86 0.31 0.82 NA [2,] 0.08 3.37 1.04 1.82 -0.50 2.79 NA [3,] 0.61 0.99 0.35 2.01 3.83 1.33 NA [4,] 0.08 1.50 0.47 0.16 0.06 0.82 NA [5,] 0.07 0.05 -0.41 1.60 0.01 -0.94 NA [6,] 0.00 0.00 0.00 0.00 0.00 0.00 NA [7,] 0.28 0.66 0.26 -0.14 -0.09 -0.04 NA [8,] 0.02 0.39 0.51 0.56 0.28 2.11 NA [9,] 0.52 0.89 2.08 0.01 0.04 0.67 NA [10,] -0.22 0.04 0.40 0.22 0.02 0.17 NA [11,] 0.11 0.20 0.20 0.02 0.03 0.22 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/1v9421413026207.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/2hday1413026207.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/3bajh1413026207.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/495qq1413026207.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.780 247.91 247.99 248.60 248.680 248.75 248.75 249.03 249.050 249.57 [2,] 249.460 250.82 254.19 255.18 256.680 256.73 256.73 257.39 257.780 258.67 [3,] 262.595 265.26 266.69 267.87 268.185 268.78 268.78 268.84 269.375 270.42 [4,] 275.400 275.71 275.21 279.04 279.100 279.11 279.11 279.02 279.300 279.34 [5,] 279.390 280.21 283.00 284.33 285.150 284.21 284.21 284.17 286.280 286.95 [,11] [,12] [1,] 249.35 249.46 [2,] 258.71 258.91 [3,] 270.73 270.84 [4,] 279.36 279.39 [5,] 287.12 287.34 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 245.8629 249.2051 253.1314 252.4795 253.7234 254.3442 254.3442 254.888 [2,] 279.3271 281.3149 280.2486 283.2605 282.6466 283.2158 283.2158 282.792 [,9] [,10] [,11] [,12] [1,] 255.4939 257.0872 257.4101 257.6297 [2,] 283.2561 283.7528 284.0499 284.0503 $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.78, 249.46, 262.595, 275.4, 279.39, 247.91, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5sanv1413026207.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.310 -0.50 0.35 0.060 -0.94 0 -0.14 0.02 0.010 -0.220 0.020 0 [2,] 0.820 0.08 0.61 0.080 -0.41 0 -0.09 0.28 0.040 0.020 0.030 0 [3,] 1.245 1.43 1.16 0.315 0.03 0 0.11 0.45 0.595 0.105 0.155 0 [4,] 2.470 2.79 2.01 0.820 0.07 0 0.28 0.56 0.890 0.220 0.200 0 [5,] 2.860 3.37 3.83 1.500 0.07 0 0.66 0.56 2.080 0.400 0.220 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.1806967 -0.3180375 0.2569548 -0.1623239 -0.2796155 0 -0.128662 [2,] 2.3093033 3.1780375 2.0630452 0.7923239 0.3396155 0 0.348662 [,8] [,9] [,10] [,11] [,12] [1,] 0.269391 0.04672255 -0.02400646 0.04534451 0 [2,] 0.630609 1.14327745 0.23400646 0.26465549 0 $out [1] 1.60 2.11 $group [1] 5 8 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(0.310000000000002, 0.819999999999993, 1.24499999999999, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6ta141413026207.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.910 249.460 261.380 269.140 275.210 279.390 NA [2,] 248.295 254.685 262.595 271.965 277.365 283.585 NA [3,] 248.750 256.730 262.960 274.660 279.105 284.270 NA [4,] 249.200 258.225 264.640 275.155 279.320 286.615 NA [5,] 249.570 258.910 266.280 275.400 279.390 287.340 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 248.3372 255.1154 262.0273 273.205 278.2133 282.888 NA [2,] 249.1628 258.3446 263.8927 276.115 279.9967 285.652 NA $out [1] 246.78 258.91 266.28 $group [1] 1 3 4 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(247.91, 248.295, 248.75, 249.2, 249.57, 249.46, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/74rw51413026207.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,] 262.7033 265.2600 262.4712 [2,] 266.3883 267.2800 266.2487 [3,] 267.7267 268.7800 268.1350 [4,] 268.8775 269.8975 269.0538 [5,] 269.4633 270.8400 269.5725 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 266.5913 267.5861 266.8556 [2,] 268.8620 269.9739 269.4144 $out [1] 262.595 $group [1] 2 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(262.703333333333, 266.388333333333, 267.726666666667, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1v9421413026207.ps tmp/1v9421413026207.png",intern=TRUE)) character(0) > try(system("convert tmp/2hday1413026207.ps tmp/2hday1413026207.png",intern=TRUE)) character(0) > try(system("convert tmp/3bajh1413026207.ps tmp/3bajh1413026207.png",intern=TRUE)) character(0) > try(system("convert tmp/495qq1413026207.ps tmp/495qq1413026207.png",intern=TRUE)) character(0) > try(system("convert tmp/5sanv1413026207.ps tmp/5sanv1413026207.png",intern=TRUE)) character(0) > try(system("convert tmp/6ta141413026207.ps tmp/6ta141413026207.png",intern=TRUE)) character(0) > try(system("convert tmp/74rw51413026207.ps tmp/74rw51413026207.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.402 0.372 2.812