R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" Copyright (C) 2013 The R Foundation for Statistical Computing 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(2.79,3.08,3.89,3.7,4.61,5.07,5.22,4.93,5.15,4.8,3.89,3.54,3.34,2.8,1.6,1.53,0.69,-0.11,-0.67,-0.2,-0.62,-0.58,-0.31,-0.25,-0.08,0.13,0.94,1.05,1.59,2.03,2.15,2.06,2.56,2.55,2.53,2.6,2.71,2.82,2.93,2.88,2.89,3.27,3.32,3.14,3.04,3.08,3.39,3.23,3.38,3.41,3.14,2.96,2.73,2.21,2.23,2.56,2.39,2.49,2.17,2.16,1.48,1.09,1.25,1.26,1.39,1.69,1.55,1.19,1.08,0.93,0.98,1.01) > 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,] 2.79 3.34 -0.08 2.71 3.38 1.48 NA [2,] 3.08 2.80 0.13 2.82 3.41 1.09 NA [3,] 3.89 1.60 0.94 2.93 3.14 1.25 NA [4,] 3.70 1.53 1.05 2.88 2.96 1.26 NA [5,] 4.61 0.69 1.59 2.89 2.73 1.39 NA [6,] 5.07 -0.11 2.03 3.27 2.21 1.69 NA [7,] 5.22 -0.67 2.15 3.32 2.23 1.55 NA [8,] 4.93 -0.20 2.06 3.14 2.56 1.19 NA [9,] 5.15 -0.62 2.56 3.04 2.39 1.08 NA [10,] 4.80 -0.58 2.55 3.08 2.49 0.93 NA [11,] 3.89 -0.31 2.53 3.39 2.17 0.98 NA [12,] 3.54 -0.25 2.60 3.23 2.16 1.01 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.29 -0.54 0.21 0.11 0.03 -0.39 NA [2,] 0.81 -1.20 0.81 0.11 -0.27 0.16 NA [3,] -0.19 -0.07 0.11 -0.05 -0.18 0.01 NA [4,] 0.91 -0.84 0.54 0.01 -0.23 0.13 NA [5,] 0.46 -0.80 0.44 0.38 -0.52 0.30 NA [6,] 0.15 -0.56 0.12 0.05 0.02 -0.14 NA [7,] -0.29 0.47 -0.09 -0.18 0.33 -0.36 NA [8,] 0.22 -0.42 0.50 -0.10 -0.17 -0.11 NA [9,] -0.35 0.04 -0.01 0.04 0.10 -0.15 NA [10,] -0.91 0.27 -0.02 0.31 -0.32 0.05 NA [11,] -0.35 0.06 0.07 -0.16 -0.01 0.03 NA [12,] -0.20 0.17 0.11 0.15 -0.68 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/1nslp1393867234.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/2esbu1393867234.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/39pwq1393867234.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/44ukj1393867234.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,] -0.08 0.13 0.940 1.050 0.69 -0.11 -0.67 -0.20 -0.620 -0.58 -0.31 -0.25 [2,] 1.48 1.09 1.250 1.260 1.39 1.69 1.55 1.19 1.080 0.93 0.98 1.01 [3,] 2.75 2.81 2.265 2.205 2.16 2.12 2.19 2.31 2.475 2.52 2.35 2.38 [4,] 3.34 3.08 3.140 2.960 2.89 3.27 3.32 3.14 3.040 3.08 3.39 3.23 [5,] 3.38 3.41 3.890 3.700 4.61 5.07 5.22 4.93 5.150 4.80 3.89 3.54 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1.55024 1.526386 1.045889 1.108445 1.192452 1.100849 1.048293 1.052187 [2,] 3.94976 4.093614 3.484111 3.301555 3.127548 3.139151 3.331707 3.567813 [,9] [,10] [,11] [,12] [1,] 1.210737 1.133181 0.7954722 0.9480283 [2,] 3.739263 3.906819 3.9045278 3.8119717 $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(-0.08, 1.48, 2.75, 3.34, 3.38, 0.13, 1.09, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5jxy21393867234.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.54 -1.200 -0.19 -0.84 -0.80 -0.140 -0.360 -0.420 -0.350 -0.910 -0.35 [2,] -0.39 -0.270 -0.18 -0.23 -0.52 -0.140 -0.290 -0.170 -0.150 -0.320 -0.16 [3,] 0.07 0.135 -0.06 0.07 0.34 0.035 -0.135 -0.105 0.015 0.015 0.01 [4,] 0.21 0.810 0.01 0.54 0.44 0.120 0.330 0.220 0.040 0.270 0.06 [5,] 0.29 0.810 0.11 0.91 0.46 0.150 0.470 0.500 0.100 0.310 0.07 [,12] [1,] -0.68 [2,] -0.20 [3,] 0.11 [4,] 0.15 [5,] 0.17 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -0.3170194 -0.5616349 -0.18255614 -0.4266749 -0.279231 -0.1327084 -0.53492 [2,] 0.4570194 0.8316349 0.06255614 0.5666749 0.959231 0.2027084 0.26492 [,8] [,9] [,10] [,11] [,12] [1,] -0.3565626 -0.1075561 -0.3655691 -0.1319071 -0.1373091 [2,] 0.1465626 0.1375561 0.3955691 0.1519071 0.3573091 $out [1] -0.56 $group [1] 6 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.54, -0.39, 0.0700000000000001, 0.21, 0.29, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6j3yk1393867234.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,] 2.79 -0.670 -0.080 2.710 2.160 0.930 NA [2,] 3.62 -0.445 0.995 2.885 2.220 1.045 NA [3,] 4.25 -0.155 2.045 3.060 2.525 1.220 NA [4,] 5.00 1.565 2.540 3.250 3.050 1.435 NA [5,] 5.22 3.340 2.600 3.390 3.410 1.690 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 3.620573 -1.0717745 1.340315 2.893521 2.146431 1.042118 NA [2,] 4.879427 0.7617745 2.749685 3.226479 2.903569 1.397882 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(2.79, 3.62, 4.25, 5, 5.22, -0.67, -0.445, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/73p2m1393867234.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,] 2.108333 2.1200 2.133750 [2,] 2.216667 2.1975 2.154375 [3,] 2.268333 2.3300 2.206875 [4,] 2.295833 2.4975 2.320000 [5,] 2.360000 2.8100 2.495000 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 2.232225 2.193168 2.131332 [2,] 2.304442 2.466832 2.282418 $out [1] 2.048333 $group [1] 1 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(2.10833333333333, 2.21666666666667, 2.26833333333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1nslp1393867234.ps tmp/1nslp1393867234.png",intern=TRUE)) character(0) > try(system("convert tmp/2esbu1393867234.ps tmp/2esbu1393867234.png",intern=TRUE)) character(0) > try(system("convert tmp/39pwq1393867234.ps tmp/39pwq1393867234.png",intern=TRUE)) character(0) > try(system("convert tmp/44ukj1393867234.ps tmp/44ukj1393867234.png",intern=TRUE)) character(0) > try(system("convert tmp/5jxy21393867234.ps tmp/5jxy21393867234.png",intern=TRUE)) character(0) > try(system("convert tmp/6j3yk1393867234.ps tmp/6j3yk1393867234.png",intern=TRUE)) character(0) > try(system("convert tmp/73p2m1393867234.ps tmp/73p2m1393867234.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.252 0.789 5.077