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(299.81,299.01,296.82,296.67,296.95,296.80,296.80,295.93,293.77,291.02,288.61,284.55,284.55,278.14,273.28,270.14,268.36,267.15,267.15,265.47,261.75,256.51,252.98,251.17,251.17,244.27,240.54,238.92,237.47,235.91,235.91,231.41,224.94,222.19,219.06,217.83,217.83,216.89,213.84,212.90,213.98,215.31,215.31,214.09,213.71,211.54,209.40,207.33,207.33,202.75,200.26,198.99,198.82,198.43,198.43,195.68,195.45,193.65,191.38,189.71,189.71,185.49,183.01,182.38,181.60,182.13,182.13,180.81,180.25,179.84,178.50,178.11,178.11,178.10,177.52,177.34,175.53,176.01,175.94,175.47,175.48,173.76,173.74,173.65,172.00,171.50,170.41,171.50,171.43,170.69,170.40,169.90,170.21,170.55,169.98,169.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] 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,] 299.81 284.55 251.17 217.83 207.33 189.71 178.11 172.00 NA [2,] 299.01 278.14 244.27 216.89 202.75 185.49 178.10 171.50 NA [3,] 296.82 273.28 240.54 213.84 200.26 183.01 177.52 170.41 NA [4,] 296.67 270.14 238.92 212.90 198.99 182.38 177.34 171.50 NA [5,] 296.95 268.36 237.47 213.98 198.82 181.60 175.53 171.43 NA [6,] 296.80 267.15 235.91 215.31 198.43 182.13 176.01 170.69 NA [7,] 296.80 267.15 235.91 215.31 198.43 182.13 175.94 170.40 NA [8,] 295.93 265.47 231.41 214.09 195.68 180.81 175.47 169.90 NA [9,] 293.77 261.75 224.94 213.71 195.45 180.25 175.48 170.21 NA [10,] 291.02 256.51 222.19 211.54 193.65 179.84 173.76 170.55 NA [11,] 288.61 252.98 219.06 209.40 191.38 178.50 173.74 169.98 NA [12,] 284.55 251.17 217.83 207.33 189.71 178.11 173.65 169.34 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] -0.80 -6.41 -6.90 -0.94 -4.58 -4.22 -0.01 -0.50 NA [2,] -2.19 -4.86 -3.73 -3.05 -2.49 -2.48 -0.58 -1.09 NA [3,] -0.15 -3.14 -1.62 -0.94 -1.27 -0.63 -0.18 1.09 NA [4,] 0.28 -1.78 -1.45 1.08 -0.17 -0.78 -1.81 -0.07 NA [5,] -0.15 -1.21 -1.56 1.33 -0.39 0.53 0.48 -0.74 NA [6,] 0.00 0.00 0.00 0.00 0.00 0.00 -0.07 -0.29 NA [7,] -0.87 -1.68 -4.50 -1.22 -2.75 -1.32 -0.47 -0.50 NA [8,] -2.16 -3.72 -6.47 -0.38 -0.23 -0.56 0.01 0.31 NA [9,] -2.75 -5.24 -2.75 -2.17 -1.80 -0.41 -1.72 0.34 NA [10,] -2.41 -3.53 -3.13 -2.14 -2.27 -1.34 -0.02 -0.57 NA [11,] -4.06 -1.81 -1.23 -2.07 -1.67 -0.39 -0.09 -0.64 NA [12,] 0.00 0.00 0.00 0.00 0.00 0.00 -1.65 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/13aal1425492914.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/2tsag1425492914.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/3i1nk1425492914.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/4yvrj1425492914.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,] 172.00 171.500 170.410 171.500 171.430 170.69 170.400 169.900 170.210 [2,] 183.91 181.795 180.265 179.860 178.565 179.07 179.035 178.140 177.865 [3,] 212.58 209.820 207.050 205.945 206.400 206.87 206.870 204.885 204.580 [4,] 267.86 261.205 256.910 254.530 252.915 251.53 251.530 248.440 243.345 [5,] 299.81 299.010 296.820 296.670 296.950 296.80 296.800 295.930 293.770 [,10] [,11] [,12] [1,] 170.550 169.98 169.34 [2,] 176.800 176.12 175.88 [3,] 202.595 200.39 198.52 [4,] 239.350 236.02 234.50 [5,] 291.020 288.61 284.55 $n [1] 8 8 8 8 8 8 8 8 8 8 8 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 165.6843 165.4604 164.235 164.2333 164.867 166.3928 166.3733 165.6144 [2,] 259.4757 254.1796 249.865 247.6567 247.933 247.3472 247.3667 244.1556 [,9] [,10] [,11] [,12] [1,] 168.0019 167.6537 166.929 165.774 [2,] 241.1581 237.5363 233.851 231.266 $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(172, 183.91, 212.58, 267.86, 299.81, 171.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5ud531425492914.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] [1,] -6.900 -4.860 -3.140 -1.810 -1.560 -0.070 -4.500 -6.47 -5.240 -3.530 [2,] -5.495 -3.390 -1.445 -1.615 -0.975 -0.035 -2.215 -2.94 -2.750 -2.770 [3,] -2.580 -2.485 -0.785 -0.475 -0.270 0.000 -1.270 -0.47 -1.985 -2.205 [4,] -0.650 -1.640 -0.165 0.105 0.505 0.000 -0.685 -0.11 -1.065 -0.955 [5,] -0.010 -0.580 1.090 1.080 1.330 0.000 -0.470 0.31 0.340 -0.020 [,11] [,12] [1,] -4.060 0 [2,] -1.940 0 [3,] -1.450 0 [4,] -0.515 0 [5,] -0.090 0 $n [1] 8 8 8 8 8 8 8 8 8 8 8 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -5.2864866 -3.462575 -1.50002638 -1.4358167 -1.0967492 -0.0195515 -2.12468 [2,] 0.1264866 -1.507425 -0.06997362 0.4858167 0.5567492 0.0195515 -0.41532 [,8] [,9] [,10] [,11] [,12] [1,] -2.050879 -2.926265 -3.218885 -2.2460255 0 [2,] 1.110879 -1.043735 -1.191115 -0.6539745 0 $out [1] -0.29 -1.65 $group [1] 6 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-6.89999999999998, -5.49500000000002, -2.58000000000001, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6zogf1425492914.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,] 288.610 251.17 217.830 209.40 189.710 178.110 173.650 169.340 NA [2,] 292.395 259.13 223.565 212.22 194.550 180.045 174.615 170.095 NA [3,] 296.735 267.15 235.910 213.91 198.430 181.865 175.735 170.480 NA [4,] 296.885 271.71 239.730 215.31 199.625 182.695 177.430 171.465 NA [5,] 299.810 284.55 251.170 217.83 202.750 185.490 178.110 172.000 NA $n [1] 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 294.6871 261.4122 228.537 212.5006 196.1153 180.6563 174.4511 169.8551 [2,] 298.7829 272.8878 243.283 215.3194 200.7447 183.0737 177.0189 171.1049 [,9] [1,] NA [2,] NA $out [1] 284.55 207.33 207.33 189.71 $group [1] 1 4 5 6 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" NA Warning message: In bxp(list(stats = c(288.61, 292.395, 296.735, 296.885, 299.81, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7tz7t1425492914.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,] 208.9613 200.3900 201.5800 [2,] 213.4137 203.5875 205.5725 [3,] 217.7812 206.1725 212.1556 [4,] 219.0325 206.9600 214.5519 [5,] 225.0637 209.8200 223.1625 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 215.2185 204.6343 208.0601 [2,] 220.3440 207.7107 216.2512 $out [1] 212.58 198.52 $group [1] 2 2 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(208.96125, 213.41375, 217.78125, 219.0325, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/13aal1425492914.ps tmp/13aal1425492914.png",intern=TRUE)) character(0) > try(system("convert tmp/2tsag1425492914.ps tmp/2tsag1425492914.png",intern=TRUE)) character(0) > try(system("convert tmp/3i1nk1425492914.ps tmp/3i1nk1425492914.png",intern=TRUE)) character(0) > try(system("convert tmp/4yvrj1425492914.ps tmp/4yvrj1425492914.png",intern=TRUE)) character(0) > try(system("convert tmp/5ud531425492914.ps tmp/5ud531425492914.png",intern=TRUE)) character(0) > try(system("convert tmp/6zogf1425492914.ps tmp/6zogf1425492914.png",intern=TRUE)) character(0) > try(system("convert tmp/7tz7t1425492914.ps tmp/7tz7t1425492914.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.585 0.458 3.066