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(8.09,8.18,8.26,8.28,8.28,8.28,8.29,8.3,8.3,8.31,8.33,8.33,8.34,8.48,8.59,8.67,8.67,8.67,8.71,8.72,8.72,8.72,8.74,8.74,8.74,8.74,8.79,8.85,8.86,8.87,8.92,8.96,8.97,8.99,8.98,8.98,9.01,9.01,9.03,9.05,9.05,9.05,9.13,9.13,9.13,9.14,9.16,9.16,9.16,9.16,9.22,9.22,9.25,9.25,9.26,9.26,9.29,9.28,9.37,9.41,9.41,9.45,9.49,9.49,9.56,9.54,9.55,9.55,9.57,9.57,9.58,9.59,9.59,9.59,9.61,9.61,9.62,9.62,9.63,9.65,9.65,9.68,9.73,9.73,9.73,9.74,9.68,9.68,9.74,9.74,9.76,9.78,9.79,9.81,9.84,9.84) > 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] 96 > (np <- floor(n / par1)) [1] 8 > 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] 8 8 8 8 8 8 8 8 8 8 8 8 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 8.09 8.34 8.74 9.01 9.16 9.41 9.59 9.73 NA [2,] 8.18 8.48 8.74 9.01 9.16 9.45 9.59 9.74 NA [3,] 8.26 8.59 8.79 9.03 9.22 9.49 9.61 9.68 NA [4,] 8.28 8.67 8.85 9.05 9.22 9.49 9.61 9.68 NA [5,] 8.28 8.67 8.86 9.05 9.25 9.56 9.62 9.74 NA [6,] 8.28 8.67 8.87 9.05 9.25 9.54 9.62 9.74 NA [7,] 8.29 8.71 8.92 9.13 9.26 9.55 9.63 9.76 NA [8,] 8.30 8.72 8.96 9.13 9.26 9.55 9.65 9.78 NA [9,] 8.30 8.72 8.97 9.13 9.29 9.57 9.65 9.79 NA [10,] 8.31 8.72 8.99 9.14 9.28 9.57 9.68 9.81 NA [11,] 8.33 8.74 8.98 9.16 9.37 9.58 9.73 9.84 NA [12,] 8.33 8.74 8.98 9.16 9.41 9.59 9.73 9.84 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 0.09 0.14 0.00 0.00 0.00 0.04 0.00 0.01 NA [2,] 0.08 0.11 0.05 0.02 0.06 0.04 0.02 -0.06 NA [3,] 0.02 0.08 0.06 0.02 0.00 0.00 0.00 0.00 NA [4,] 0.00 0.00 0.01 0.00 0.03 0.07 0.01 0.06 NA [5,] 0.00 0.00 0.01 0.00 0.00 -0.02 0.00 0.00 NA [6,] 0.01 0.04 0.05 0.08 0.01 0.01 0.01 0.02 NA [7,] 0.01 0.01 0.04 0.00 0.00 0.00 0.02 0.02 NA [8,] 0.00 0.00 0.01 0.00 0.03 0.02 0.00 0.01 NA [9,] 0.01 0.00 0.02 0.01 -0.01 0.00 0.03 0.02 NA [10,] 0.02 0.02 -0.01 0.02 0.09 0.01 0.05 0.03 NA [11,] 0.00 0.00 0.00 0.00 0.04 0.01 0.00 0.00 NA [12,] 0.01 0.00 0.03 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/14bf31424964134.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/20aum1424964134.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/32ywt1424964134.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/4u4ff1424964134.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] [,11] [,12] [1,] 8.090 8.180 8.260 8.280 8.280 8.28 8.290 8.300 8.300 8.310 8.330 8.330 [2,] 8.540 8.610 8.690 8.760 8.765 8.77 8.815 8.840 8.845 8.855 8.860 8.860 [3,] 9.085 9.085 9.125 9.135 9.150 9.15 9.195 9.195 9.210 9.210 9.265 9.285 [4,] 9.500 9.520 9.550 9.550 9.590 9.58 9.590 9.600 9.610 9.625 9.655 9.660 [5,] 9.730 9.740 9.680 9.680 9.740 9.74 9.760 9.780 9.790 9.810 9.840 9.840 $n [1] 8 8 8 8 8 8 8 8 8 8 8 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 8.54873 8.576661 8.644592 8.693695 8.689143 8.697522 8.762074 8.770453 [2,] 9.62127 9.593339 9.605408 9.576305 9.610857 9.602478 9.627926 9.619547 [,9] [,10] [,11] [,12] [1,] 8.78266 8.779867 8.820902 8.838109 [2,] 9.63734 9.640133 9.709098 9.731891 $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(8.09, 8.54, 9.085, 9.5, 9.73, 8.18, 8.61, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/584tg1424964134.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.000 0.020 0.00 0.000 0 0.010 0.00 0.000 -0.01 -0.010 0.000 0.000 [2,] 0.000 0.020 0.00 0.000 0 0.010 0.00 0.000 0.00 0.015 0.000 0.000 [3,] 0.005 0.045 0.01 0.010 0 0.015 0.01 0.005 0.01 0.020 0.000 0.000 [4,] 0.065 0.070 0.04 0.045 0 0.045 0.02 0.015 0.02 0.040 0.005 0.005 [5,] 0.140 0.110 0.08 0.070 0 0.080 0.04 0.030 0.03 0.050 0.010 0.010 $n [1] 8 8 8 8 8 8 8 8 8 8 8 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.03130993 0.01706928 -0.01234457 -0.01513765 0 -0.004551502 [2,] 0.04130993 0.07293072 0.03234457 0.03513765 0 0.034551502 [,7] [,8] [,9] [,10] [,11] [1,] -0.001172287 -0.003379215 -0.001172287 0.006034641 -0.002793072 [2,] 0.021172287 0.013379215 0.021172287 0.033965359 0.002793072 [,12] [1,] -0.002985919 [2,] 0.002985919 $out [1] -0.06 0.01 -0.02 0.09 0.04 0.03 $group [1] 2 5 5 10 11 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(0, 0, 0.00499999999999989, 0.0649999999999995, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6zkol1424964134.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] [,8] [,9] [1,] 8.260 8.59 8.740 9.010 9.160 9.41 9.590 9.680 NA [2,] 8.270 8.63 8.820 9.040 9.220 9.49 9.610 9.735 NA [3,] 8.285 8.69 8.895 9.090 9.255 9.55 9.625 9.750 NA [4,] 8.305 8.72 8.975 9.135 9.285 9.57 9.665 9.800 NA [5,] 8.330 8.74 8.990 9.160 9.370 9.59 9.730 9.840 NA $n [1] 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 8.269036 8.64895 8.824303 9.04667 9.225353 9.513511 9.599914 9.720353 NA [2,] 8.300964 8.73105 8.965697 9.13333 9.284647 9.586489 9.650086 9.779647 NA $out [1] 8.09 8.18 8.34 8.48 9.41 $group [1] 1 1 2 2 5 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" NA Warning message: In bxp(list(stats = c(8.26, 8.27, 8.285, 8.305, 8.33, 8.59, 8.63, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7byws1424964134.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,] 9.00875 9.0850 9.047500 [2,] 9.09500 9.1300 9.146250 [3,] 9.14250 9.1725 9.206250 [4,] 9.18250 9.2100 9.254375 [5,] 9.22250 9.2850 9.272500 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 9.102591 9.136011 9.156933 [2,] 9.182409 9.208989 9.255567 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(9.00875, 9.095, 9.1425, 9.1825, 9.2225, 9.085, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/14bf31424964134.ps tmp/14bf31424964134.png",intern=TRUE)) character(0) > try(system("convert tmp/20aum1424964134.ps tmp/20aum1424964134.png",intern=TRUE)) character(0) > try(system("convert tmp/32ywt1424964134.ps tmp/32ywt1424964134.png",intern=TRUE)) character(0) > try(system("convert tmp/4u4ff1424964134.ps tmp/4u4ff1424964134.png",intern=TRUE)) character(0) > try(system("convert tmp/584tg1424964134.ps tmp/584tg1424964134.png",intern=TRUE)) character(0) > try(system("convert tmp/6zkol1424964134.ps tmp/6zkol1424964134.png",intern=TRUE)) character(0) > try(system("convert tmp/7byws1424964134.ps tmp/7byws1424964134.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.502 0.475 3.007