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(123,146,156,127,128,147,128,139,130,118,147,98,141,138,130,145,123,116,90,110,102,109,111,93,120,81,84,87,110,90,108,101,87,118,82,86,103,93,83,91,69,95,96,105,121,101,111,130,134,161,186,244,145,170,164,124,154,126,173,140,142,129,171,107,98,185,142,135,126,126,134,119,134,133,129,96,150,113,99,164,127,148,166,115,199,141,149,131,171,178,181,129,112,186,153,116,190,169,165,160,202,155,257,171,168,202,189,132) > 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] 108 > (np <- floor(n / par1)) [1] 9 > 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] 9 9 9 9 9 9 9 9 9 9 9 9 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 123 141 120 103 134 142 134 199 190 NA [2,] 146 138 81 93 161 129 133 141 169 NA [3,] 156 130 84 83 186 171 129 149 165 NA [4,] 127 145 87 91 244 107 96 131 160 NA [5,] 128 123 110 69 145 98 150 171 202 NA [6,] 147 116 90 95 170 185 113 178 155 NA [7,] 128 90 108 96 164 142 99 181 257 NA [8,] 139 110 101 105 124 135 164 129 171 NA [9,] 130 102 87 121 154 126 127 112 168 NA [10,] 118 109 118 101 126 126 148 186 202 NA [11,] 147 111 82 111 173 134 166 153 189 NA [12,] 98 93 86 130 140 119 115 116 132 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 23 -3 -39 -10 27 -13 -1 -58 -21 NA [2,] 10 -8 3 -10 25 42 -4 8 -4 NA [3,] -29 15 3 8 58 -64 -33 -18 -5 NA [4,] 1 -22 23 -22 -99 -9 54 40 42 NA [5,] 19 -7 -20 26 25 87 -37 7 -47 NA [6,] -19 -26 18 1 -6 -43 -14 3 102 NA [7,] 11 20 -7 9 -40 -7 65 -52 -86 NA [8,] -9 -8 -14 16 30 -9 -37 -17 -3 NA [9,] -12 7 31 -20 -28 0 21 74 34 NA [10,] 29 2 -36 10 47 8 18 -33 -13 NA [11,] -49 -18 4 19 -33 -15 -51 -37 -57 NA [12,] 43 27 17 4 2 15 84 74 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/1u5qu1412944535.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/2f5f61412944535.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/3495q1412944535.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/48vho1412944535.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,] 103 129 83 87 69 90 90 101 87 101 82 86 [2,] 123 129 129 96 110 113 99 110 112 118 111 98 [3,] 134 138 149 127 128 147 128 129 126 126 147 116 [4,] 142 146 165 145 150 170 164 139 130 148 166 130 [5,] 142 169 186 160 202 185 257 171 154 186 189 140 $n [1] 9 9 9 9 9 9 9 9 9 9 9 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 123.9933 129.0467 130.04 101.1933 106.9333 116.98 93.76667 113.7267 [2,] 144.0067 146.9533 167.96 152.8067 149.0667 177.02 162.23333 144.2733 [,9] [,10] [,11] [,12] [1,] 116.52 110.2 118.0333 99.14667 [2,] 135.48 141.8 175.9667 132.85333 $out [1] 199 190 81 93 244 168 202 $group [1] 1 1 2 2 4 9 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(103, 123, 134, 142, 142, 129, 129, 138, 146, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/55fuo1412944535.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,] -39 -10 -64 -99 -47 -43 -86 -17 -28 -36 -57 2.0 [2,] -21 -4 -29 -22 -20 -19 -40 -14 -12 -13 -49 9.5 [3,] -10 3 -5 1 7 -6 -7 -9 7 8 -33 22.0 [4,] -1 10 8 40 25 3 11 -3 31 18 -15 58.5 [5,] 27 25 58 54 87 18 65 -3 74 47 19 84.0 $n [1] 9 9 9 9 9 9 9 9 9 9 9 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -20.5333333 -4.373333 -24.48667 -31.65333 -16.7 -17.586667 -33.86 [2,] 0.5333333 10.373333 14.48667 33.65333 30.7 5.586667 19.86 [,8] [,9] [,10] [,11] [,12] [1,] -14.793333 -15.64667 -8.326667 -50.90667 -5.372103 [2,] -3.206667 29.64667 24.326667 -15.09333 49.372103 $out [1] -58 42 102 16 30 -37 $group [1] 1 2 6 8 8 8 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-39, -21, -10, -1, 27, -10, -4, 3, 10, 25, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/67a9n1412944535.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] [,10] [1,] 98.0 90.0 81.0 69.0 124.0 98.0 96 112.0 132.0 NA [2,] 125.0 105.5 85.0 92.0 137.0 122.5 114 130.0 162.5 NA [3,] 129.0 113.5 88.5 98.5 157.5 131.5 131 151.0 170.0 NA [4,] 146.5 134.0 109.0 108.0 171.5 142.0 149 179.5 196.0 NA [5,] 156.0 145.0 120.0 130.0 186.0 171.0 166 199.0 202.0 NA $n [1] 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 119.1937 100.501 77.55344 91.20229 141.7643 122.6059 115.0363 128.4227 [2,] 138.8063 126.499 99.44656 105.79771 173.2357 140.3941 146.9637 173.5773 [,9] [,10] [1,] 154.7204 NA [2,] 185.2796 NA $out [1] 244 185 257 $group [1] 5 6 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" NA Warning message: In bxp(list(stats = c(98, 125, 129, 146.5, 156, 90, 105.5, 113.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7ft671412944535.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,] 125.2222 116.0 114.00 [2,] 131.4444 126.5 122.75 [3,] 135.0000 128.5 132.00 [4,] 139.8889 142.5 138.00 [5,] 142.8889 149.0 147.00 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 131.1484 121.2023 125.0444 [2,] 138.8516 135.7977 138.9556 $out [1] 114.3333 $group [1] 1 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(125.222222222222, 131.444444444444, 135, 139.888888888889, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1u5qu1412944535.ps tmp/1u5qu1412944535.png",intern=TRUE)) character(0) > try(system("convert tmp/2f5f61412944535.ps tmp/2f5f61412944535.png",intern=TRUE)) character(0) > try(system("convert tmp/3495q1412944535.ps tmp/3495q1412944535.png",intern=TRUE)) character(0) > try(system("convert tmp/48vho1412944535.ps tmp/48vho1412944535.png",intern=TRUE)) character(0) > try(system("convert tmp/55fuo1412944535.ps tmp/55fuo1412944535.png",intern=TRUE)) character(0) > try(system("convert tmp/67a9n1412944535.ps tmp/67a9n1412944535.png",intern=TRUE)) character(0) > try(system("convert tmp/7ft671412944535.ps tmp/7ft671412944535.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.432 0.418 2.876