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(99.42,99.42,99.42,99.42,99.42,109.26,110.00,110.00,109.26,100.07,100.07,100.05,100.05,100.05,100.05,100.05,100.05,108.77,111.32,111.60,108.52,103.13,102.87,102.75,102.75,102.75,102.75,102.75,102.75,115.22,115.53,115.40,111.99,107.93,107.43,106.98,106.98,106.98,106.98,106.98,106.98,113.71,118.77,118.54,116.16,110.52,110.06,109.90,109.90,110.72,110.09,110.07,112.45,113.06,119.83,119.84,113.73,110.50,110.12,109.86,110.36,110.36,110.59,112.52,112.10,115.90,122.96,121.26,114.55,111.57,110.65,109.77) > 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,] 99.42 100.05 102.75 106.98 109.90 110.36 NA [2,] 99.42 100.05 102.75 106.98 110.72 110.36 NA [3,] 99.42 100.05 102.75 106.98 110.09 110.59 NA [4,] 99.42 100.05 102.75 106.98 110.07 112.52 NA [5,] 99.42 100.05 102.75 106.98 112.45 112.10 NA [6,] 109.26 108.77 115.22 113.71 113.06 115.90 NA [7,] 110.00 111.32 115.53 118.77 119.83 122.96 NA [8,] 110.00 111.60 115.40 118.54 119.84 121.26 NA [9,] 109.26 108.52 111.99 116.16 113.73 114.55 NA [10,] 100.07 103.13 107.93 110.52 110.50 111.57 NA [11,] 100.07 102.87 107.43 110.06 110.12 110.65 NA [12,] 100.05 102.75 106.98 109.90 109.86 109.77 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.00 0.00 0.00 0.00 0.82 0.00 NA [2,] 0.00 0.00 0.00 0.00 -0.63 0.23 NA [3,] 0.00 0.00 0.00 0.00 -0.02 1.93 NA [4,] 0.00 0.00 0.00 0.00 2.38 -0.42 NA [5,] 9.84 8.72 12.47 6.73 0.61 3.80 NA [6,] 0.74 2.55 0.31 5.06 6.77 7.06 NA [7,] 0.00 0.28 -0.13 -0.23 0.01 -1.70 NA [8,] -0.74 -3.08 -3.41 -2.38 -6.11 -6.71 NA [9,] -9.19 -5.39 -4.06 -5.64 -3.23 -2.98 NA [10,] 0.00 -0.26 -0.50 -0.46 -0.38 -0.92 NA [11,] -0.02 -0.12 -0.45 -0.16 -0.26 -0.88 NA [12,] 0.00 0.00 0.00 0.00 0.50 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/1kyn21350632260.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/27fsp1350632260.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/36xin1350632260.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/47ug31350632260.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] [1,] 99.420 99.420 99.420 99.420 99.420 108.770 110.00 110.00 108.52 [2,] 100.050 100.050 100.050 100.050 100.050 109.260 111.32 111.60 109.26 [3,] 104.865 104.865 104.865 104.865 104.865 113.385 117.15 116.97 112.86 [4,] 109.900 110.360 110.090 110.070 112.100 115.220 119.83 119.84 114.55 [5,] 110.360 110.720 110.590 112.520 112.450 115.900 122.96 121.26 116.16 [,10] [,11] [,12] [1,] 100.070 100.070 100.050 [2,] 103.130 102.870 102.750 [3,] 109.215 108.745 108.375 [4,] 110.520 110.120 109.860 [5,] 111.570 110.650 109.900 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 98.51143 98.21472 98.38888 98.40178 97.09236 109.5406 111.6608 [2,] 111.21857 111.51528 111.34112 111.32822 112.63764 117.2294 122.6392 [,8] [,9] [,10] [,11] [,12] [1,] 111.6549 109.4478 104.4482 104.0685 103.7888 [2,] 122.2851 116.2722 113.9818 113.4215 112.9612 $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(99.42, 100.05, 104.865, 109.9, 110.36, 99.42, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5b7up1350632260.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 0 0 0 0.610 0.310 -0.230 -6.710 -9.190 -0.50 -0.88 0 [2,] 0 0 0 0 3.800 0.740 -0.230 -6.110 -5.640 -0.50 -0.45 0 [3,] 0 0 0 0 7.725 3.805 -0.065 -3.245 -4.725 -0.42 -0.21 0 [4,] 0 0 0 0 9.840 6.770 0.010 -2.380 -3.230 -0.26 -0.12 0 [5,] 0 0 0 0 12.470 7.060 0.280 -0.740 -2.980 0.00 -0.02 0 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 0 0 0 0 3.829005 -0.08454476 -0.21980775 -5.6509705 -6.279528 [2,] 0 0 0 0 11.620995 7.69454476 0.08980775 -0.8390295 -3.170472 [,10] [,11] [,12] [1,] -0.5748078 -0.422860659 0 [2,] -0.2651922 0.002860659 0 $out [1] 0.82 -0.63 0.23 -0.02 1.93 2.38 -0.42 -1.70 -0.92 0.50 $group [1] 1 2 2 3 3 4 4 7 10 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6fnbz1350632260.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,] 99.42 100.050 102.750 106.980 109.860 109.770 NA [2,] 99.42 100.050 102.750 106.980 110.080 110.475 NA [3,] 100.06 102.810 107.205 109.980 110.610 111.835 NA [4,] 109.26 108.645 113.605 114.935 113.395 115.225 NA [5,] 110.00 111.600 115.530 118.770 113.730 121.260 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 95.57191 98.88976 102.254 106.3517 109.098 109.6685 NA [2,] 104.54809 106.73024 112.156 113.6083 112.122 114.0015 NA $out [1] 119.83 119.84 122.96 $group [1] 5 5 6 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(99.42, 99.42, 100.06, 109.26, 110, 100.05, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/74f1b1350632260.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,] 104.9100 104.8650 104.9475 [2,] 105.1725 104.8650 105.0694 [3,] 106.7092 108.5600 106.9400 [4,] 112.5108 113.1225 112.3350 [5,] 116.4017 117.1500 116.0325 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 103.3621 104.7937 103.6261 [2,] 110.0562 112.3263 110.2539 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(104.91, 105.1725, 106.709166666667, 112.510833333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1kyn21350632260.ps tmp/1kyn21350632260.png",intern=TRUE)) character(0) > try(system("convert tmp/27fsp1350632260.ps tmp/27fsp1350632260.png",intern=TRUE)) character(0) > try(system("convert tmp/36xin1350632260.ps tmp/36xin1350632260.png",intern=TRUE)) character(0) > try(system("convert tmp/47ug31350632260.ps tmp/47ug31350632260.png",intern=TRUE)) character(0) > try(system("convert tmp/5b7up1350632260.ps tmp/5b7up1350632260.png",intern=TRUE)) character(0) > try(system("convert tmp/6fnbz1350632260.ps tmp/6fnbz1350632260.png",intern=TRUE)) character(0) > try(system("convert tmp/74f1b1350632260.ps tmp/74f1b1350632260.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.250 0.568 3.880