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(3862.5,3875.7,3875.9,3877.7,3880.4,3883.4,3884.2,3884.8,3894.9,3903.3,3911.2,3928.9,3945.6,3965.7,3992.3,4008.7,4014.8,4020.6,4037.5,4058.5,4082.3,4102.4,4127.1,4144.4,4161,4168.2,4178.3,4174.1,4165.7,4167.9,4158.3,4158.3,4143.7,4157.5,4164.8,4173.9,4181.2,4190.7,4206.6,4222.1,4245.8,4255.4,4266.1,4273.6,4282.1,4299.8,4315.7,4331.7,4348.4,4367.8,4387.2,4410.9,4436,4453.8,4469.1,4472,4458.2,4449,4441.5,4445.7,4453.9,4469.7,4487.5,4504,4524.1,4540.5,4548.4,4554.2,4558,4557.5,4554.5,4550,4543.8,4538.2,4543.3,4545.1) > par1 = '4' > par1 <- '4' > #'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] 76 > (np <- floor(n / par1)) [1] 19 > 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] 19 19 19 19 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 3862.5 3880.4 3894.9 3945.6 4014.8 4082.3 4161.0 4165.7 4143.7 4181.2 [2,] 3875.7 3883.4 3903.3 3965.7 4020.6 4102.4 4168.2 4167.9 4157.5 4190.7 [3,] 3875.9 3884.2 3911.2 3992.3 4037.5 4127.1 4178.3 4158.3 4164.8 4206.6 [4,] 3877.7 3884.8 3928.9 4008.7 4058.5 4144.4 4174.1 4158.3 4173.9 4222.1 [,11] [,12] [,13] [,14] [,15] [,16] [,17] [,18] [,19] [,20] [1,] 4245.8 4282.1 4348.4 4436.0 4458.2 4453.9 4524.1 4558.0 4543.8 NA [2,] 4255.4 4299.8 4367.8 4453.8 4449.0 4469.7 4540.5 4557.5 4538.2 NA [3,] 4266.1 4315.7 4387.2 4469.1 4441.5 4487.5 4548.4 4554.5 4543.3 NA [4,] 4273.6 4331.7 4410.9 4472.0 4445.7 4504.0 4554.2 4550.0 4545.1 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [1,] 13.2 3.0 8.4 20.1 5.8 20.1 7.2 2.2 13.8 9.5 9.6 17.7 19.4 [2,] 0.2 0.8 7.9 26.6 16.9 24.7 10.1 -9.6 7.3 15.9 10.7 15.9 19.4 [3,] 1.8 0.6 17.7 16.4 21.0 17.3 -4.2 0.0 9.1 15.5 7.5 16.0 23.7 [4,] 2.7 10.1 16.7 6.1 23.8 16.6 -8.4 -14.6 7.3 23.7 8.5 16.7 25.1 [,14] [,15] [,16] [,17] [,18] [,19] [,20] [1,] 17.8 -9.2 15.8 16.4 -0.5 -5.6 NA [2,] 15.3 -7.5 17.8 7.9 -3.0 5.1 NA [3,] 2.9 4.2 16.5 5.8 -4.5 1.8 NA [4,] -13.8 8.2 20.1 3.8 -6.2 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/13cr71424864751.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/2ie4p1424864751.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/3hijx1424864751.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/4od721424864751.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] [1,] 3862.50 3875.7 3875.9 3877.70 [2,] 4048.55 4061.5 4082.3 4101.45 [3,] 4181.20 4190.7 4206.6 4222.10 [4,] 4444.95 4451.4 4455.3 4458.85 [5,] 4558.00 4557.5 4554.5 4554.20 $n [1] 19 19 19 19 $conf [,1] [,2] [,3] [,4] [1,] 4037.514 4049.37 4071.396 4092.551 [2,] 4324.886 4332.03 4341.804 4351.649 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" Warning message: In bxp(list(stats = c(3862.5, 4048.55, 4181.2, 4444.95, 4558, 3875.7, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5umv71424864751.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] [1,] -9.20 -9.60 -4.50 -14.60 [2,] 4.40 2.95 1.80 2.70 [3,] 9.60 10.10 7.50 8.35 [4,] 17.05 16.40 16.45 16.70 [5,] 20.10 26.60 23.70 25.10 $n [1] 19 19 19 18 $conf [,1] [,2] [,3] [,4] [1,] 5.014668 5.224686 2.189714 3.136266 [2,] 14.185332 14.975314 12.810286 13.563734 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6t9ag1424864751.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,] 3862.5 3880.4 3894.90 3945.60 4014.80 4082.30 4161.00 4158.3 4143.70 [2,] 3869.1 3881.9 3899.10 3955.65 4017.70 4092.35 4164.60 4158.3 4150.60 [3,] 3875.8 3883.8 3907.25 3979.00 4029.05 4114.75 4171.15 4162.0 4161.15 [4,] 3876.8 3884.5 3920.05 4000.50 4048.00 4135.75 4176.20 4166.8 4169.35 [5,] 3877.7 3884.8 3928.90 4008.70 4058.50 4144.40 4178.30 4167.9 4173.90 [,10] [,11] [,12] [,13] [,14] [,15] [,16] [,17] [,18] [1,] 4181.20 4245.80 4282.10 4348.40 4436.00 4441.50 4453.90 4524.10 4550.00 [2,] 4185.95 4250.60 4290.95 4358.10 4444.90 4443.60 4461.80 4532.30 4552.25 [3,] 4198.65 4260.75 4307.75 4377.50 4461.45 4447.35 4478.60 4544.45 4556.00 [4,] 4214.35 4269.85 4323.70 4399.05 4470.55 4453.60 4495.75 4551.30 4557.75 [5,] 4222.10 4273.60 4331.70 4410.90 4472.00 4458.20 4504.00 4554.20 4558.00 [,19] [,20] [1,] 4538.20 NA [2,] 4540.75 NA [3,] 4543.55 NA [4,] 4544.45 NA [5,] 4545.10 NA $n [1] 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 3869.717 3881.746 3890.7 3943.568 4005.113 4080.464 4161.986 4155.285 [2,] 3881.883 3885.854 3923.8 4014.432 4052.987 4149.036 4180.314 4168.715 [,9] [,10] [,11] [,12] [,13] [,14] [,15] [,16] [1,] 4146.337 4176.214 4245.542 4281.878 4345.15 4441.187 4439.45 4451.779 [2,] 4175.962 4221.086 4275.958 4333.622 4409.85 4481.714 4455.25 4505.421 [,17] [,18] [,19] [,20] [1,] 4529.44 4551.655 4540.627 NA [2,] 4559.46 4560.345 4546.473 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14" "15" [16] "16" "17" "18" "19" NA Warning message: In bxp(list(stats = c(3862.5, 3869.1, 3875.8, 3876.8, 3877.7, 3880.4, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7byrx1424864751.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,] 4220.126 4181.20 4246.750 [2,] 4224.987 4185.95 4251.600 [3,] 4234.647 4198.65 4262.625 [4,] 4243.897 4214.35 4274.475 [5,] 4248.347 4222.10 4280.150 $n [1] 4 4 4 $conf [,1] [,2] [,3] [1,] 4219.708 4176.214 4244.554 [2,] 4249.587 4221.086 4280.696 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(4220.12631578947, 4224.98684210526, 4234.64736842105, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/13cr71424864751.ps tmp/13cr71424864751.png",intern=TRUE)) character(0) > try(system("convert tmp/2ie4p1424864751.ps tmp/2ie4p1424864751.png",intern=TRUE)) character(0) > try(system("convert tmp/3hijx1424864751.ps tmp/3hijx1424864751.png",intern=TRUE)) character(0) > try(system("convert tmp/4od721424864751.ps tmp/4od721424864751.png",intern=TRUE)) character(0) > try(system("convert tmp/5umv71424864751.ps tmp/5umv71424864751.png",intern=TRUE)) character(0) > try(system("convert tmp/6t9ag1424864751.ps tmp/6t9ag1424864751.png",intern=TRUE)) character(0) > try(system("convert tmp/7byrx1424864751.ps tmp/7byrx1424864751.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.532 0.372 2.927