R version 2.15.3 (2013-03-01) -- "Security Blanket" Copyright (C) 2013 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(7.14,7.11,7.21,7.25,7.25,7.45,7.45,7.49,7.47,7.49,7.47,7.51,7.52,7.5,7.54,7.54,7.57,7.53,7.54,7.63,7.61,7.64,7.68,7.7,7.72,7.71,7.77,7.83,7.85,7.89,8.01,8.18,8.25,8.31,8.34,8.38,8.36,8.34,8.34,8.3,8.35,8.36,8.34,8.39,8.23,8.14,8.04,8.05,7.99,8.17,8.22,8.12,8.11,8.12,8.11,8.03,8.03,7.96,7.96,7.87,7.9,7.87,7.94,7.82,7.83,7.86,7.81,7.76,7.75,7.75,7.74,7.72) > 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,] 7.14 7.52 7.72 8.36 7.99 7.90 NA [2,] 7.11 7.50 7.71 8.34 8.17 7.87 NA [3,] 7.21 7.54 7.77 8.34 8.22 7.94 NA [4,] 7.25 7.54 7.83 8.30 8.12 7.82 NA [5,] 7.25 7.57 7.85 8.35 8.11 7.83 NA [6,] 7.45 7.53 7.89 8.36 8.12 7.86 NA [7,] 7.45 7.54 8.01 8.34 8.11 7.81 NA [8,] 7.49 7.63 8.18 8.39 8.03 7.76 NA [9,] 7.47 7.61 8.25 8.23 8.03 7.75 NA [10,] 7.49 7.64 8.31 8.14 7.96 7.75 NA [11,] 7.47 7.68 8.34 8.04 7.96 7.74 NA [12,] 7.51 7.70 8.38 8.05 7.87 7.72 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -0.03 -0.02 -0.01 -0.02 0.18 -0.03 NA [2,] 0.10 0.04 0.06 0.00 0.05 0.07 NA [3,] 0.04 0.00 0.06 -0.04 -0.10 -0.12 NA [4,] 0.00 0.03 0.02 0.05 -0.01 0.01 NA [5,] 0.20 -0.04 0.04 0.01 0.01 0.03 NA [6,] 0.00 0.01 0.12 -0.02 -0.01 -0.05 NA [7,] 0.04 0.09 0.17 0.05 -0.08 -0.05 NA [8,] -0.02 -0.02 0.07 -0.16 0.00 -0.01 NA [9,] 0.02 0.03 0.06 -0.09 -0.07 0.00 NA [10,] -0.02 0.04 0.03 -0.10 0.00 -0.01 NA [11,] 0.04 0.02 0.04 0.01 -0.09 -0.02 NA [12,] 0.01 0.02 -0.02 -0.06 0.03 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/17wbk1363122340.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/255z61363122340.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/32rql1363122340.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/4ljfy1363122340.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,] 7.14 7.11 7.210 7.250 7.25 7.450 7.45 7.490 7.47 7.490 7.47 7.510 [2,] 7.52 7.50 7.540 7.540 7.57 7.530 7.54 7.630 7.61 7.640 7.68 7.700 [3,] 7.81 7.79 7.855 7.825 7.84 7.875 7.91 7.895 7.89 7.855 7.85 7.795 [4,] 7.99 8.17 8.220 8.120 8.11 8.120 8.11 8.180 8.23 8.140 8.04 8.050 [5,] 8.36 8.34 8.340 8.300 8.35 8.360 8.34 8.390 8.25 8.310 8.34 8.380 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 7.506835 7.357828 7.416378 7.450881 7.491683 7.494431 7.542332 7.540232 [2,] 8.113165 8.222172 8.293622 8.199119 8.188317 8.255569 8.277668 8.249768 [,9] [,10] [,11] [,12] [1,] 7.49008 7.532484 7.617788 7.569239 [2,] 8.28992 8.177516 8.082212 8.020761 $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(7.14, 7.52, 7.81, 7.99, 8.36, 7.11, 7.5, 7.79, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5gsjh1363122340.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] [1,] -0.03 0.000 -0.12 -0.010 0.01 -0.050 -0.080 -0.020 -0.09 -0.020 -0.090 [2,] -0.03 0.040 -0.10 0.000 0.01 -0.020 -0.050 -0.020 -0.07 -0.020 -0.020 [3,] -0.02 0.055 -0.02 0.015 0.02 -0.005 0.045 -0.015 0.01 -0.005 0.015 [4,] -0.01 0.070 0.04 0.030 0.04 0.010 0.090 0.000 0.03 0.030 0.040 [5,] -0.01 0.100 0.06 0.050 0.04 0.010 0.170 0.000 0.06 0.040 0.040 [,12] [1,] -0.06 [2,] -0.02 [3,] 0.01 [4,] 0.02 [5,] 0.03 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.032900646 0.03564903 -0.11030452 -0.004350969 0.000649031 -0.02435097 [2,] -0.007099354 0.07435097 0.07030452 0.034350969 0.039350969 0.01435097 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.04530452 -0.027900646 -0.05450323 -0.03725161 -0.02370194 -0.0182639 [2,] 0.13530452 -0.002099354 0.07450323 0.02725161 0.05370194 0.0382639 $out [1] 0.18 0.20 -0.04 0.12 0.07 -0.16 -0.10 $group [1] 1 5 5 6 8 8 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.0300000000000002, -0.0299999999999994, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6u9xt1363122340.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,] 7.11 7.500 7.71 8.040 7.870 7.720 NA [2,] 7.23 7.535 7.80 8.185 7.975 7.750 NA [3,] 7.45 7.555 7.95 8.340 8.070 7.815 NA [4,] 7.48 7.635 8.28 8.355 8.120 7.865 NA [5,] 7.51 7.700 8.38 8.390 8.220 7.940 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 7.335973 7.509389 7.731069 8.262462 8.003865 7.762548 NA [2,] 7.564027 7.600611 8.168931 8.417538 8.136135 7.867452 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(7.11, 7.23, 7.45, 7.48, 7.51, 7.5, 7.535, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7jd7x1363122340.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,] 7.771667 7.7900 7.768750 [2,] 7.818333 7.8175 7.833125 [3,] 7.870000 7.8525 7.850625 [4,] 7.879167 7.8825 7.877500 [5,] 7.913333 7.9100 7.912500 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 7.842254 7.822853 7.830385 [2,] 7.897746 7.882147 7.870865 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(7.77166666666667, 7.81833333333333, 7.87, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/17wbk1363122340.ps tmp/17wbk1363122340.png",intern=TRUE)) character(0) > try(system("convert tmp/255z61363122340.ps tmp/255z61363122340.png",intern=TRUE)) character(0) > try(system("convert tmp/32rql1363122340.ps tmp/32rql1363122340.png",intern=TRUE)) character(0) > try(system("convert tmp/4ljfy1363122340.ps tmp/4ljfy1363122340.png",intern=TRUE)) character(0) > try(system("convert tmp/5gsjh1363122340.ps tmp/5gsjh1363122340.png",intern=TRUE)) character(0) > try(system("convert tmp/6u9xt1363122340.ps tmp/6u9xt1363122340.png",intern=TRUE)) character(0) > try(system("convert tmp/7jd7x1363122340.ps tmp/7jd7x1363122340.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.293 0.572 3.852