R version 2.8.0 (2008-10-20) Copyright (C) 2008 The R Foundation for Statistical Computing ISBN 3-900051-07-0 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(3032.9,2630.8,2851.4,3029.7,2856.4,2899.2,2784.9,2764.2,2770.0,2335.6,2700.9,2941.0,2489.2,2378.3,2404.6,2661.4,2559.3,2431.0,2670.2,2333.8,2441.9,2215.9,2482.9,2520.4,2423.8,2262.3,2190.8,2606.3,2547.9,2281.4,2594.1,2174.8,2158.6,2282.5,2368.1,2316.1,2404.9,2025.7,1931.9,2376.5,2091.7,2232.5,2355.8,2066.1,2014.4,2330.4,2198.2,2287.0,2371.4,1872.4,1983.8,2285.6,1965.0,2213.0,2246.3,1889.4,1907.4,1955.1,1863.6,2161.5) > par1 = '36' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: Wessa P., (2007), Mean Plot (v1.0.1) 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 > #Technical description: Write here your technical program description > par1 <- as.numeric(par1) > (n <- length(x)) [1] 60 > (np <- floor(n / par1)) [1] 1 > arr <- array(NA,dim=c(par1,np+1)) > ari <- array(0,dim=par1) > j <- 0 > for (i in 1:n) + { + j = j + 1 + ari[j] = ari[j] + 1 + arr[j,ari[j]] <- x[i] + if (j == par1) j = 0 + } > ari [1] 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 > arr [,1] [,2] [1,] 3032.9 2404.9 [2,] 2630.8 2025.7 [3,] 2851.4 1931.9 [4,] 3029.7 2376.5 [5,] 2856.4 2091.7 [6,] 2899.2 2232.5 [7,] 2784.9 2355.8 [8,] 2764.2 2066.1 [9,] 2770.0 2014.4 [10,] 2335.6 2330.4 [11,] 2700.9 2198.2 [12,] 2941.0 2287.0 [13,] 2489.2 2371.4 [14,] 2378.3 1872.4 [15,] 2404.6 1983.8 [16,] 2661.4 2285.6 [17,] 2559.3 1965.0 [18,] 2431.0 2213.0 [19,] 2670.2 2246.3 [20,] 2333.8 1889.4 [21,] 2441.9 1907.4 [22,] 2215.9 1955.1 [23,] 2482.9 1863.6 [24,] 2520.4 2161.5 [25,] 2423.8 NA [26,] 2262.3 NA [27,] 2190.8 NA [28,] 2606.3 NA [29,] 2547.9 NA [30,] 2281.4 NA [31,] 2594.1 NA [32,] 2174.8 NA [33,] 2158.6 NA [34,] 2282.5 NA [35,] 2368.1 NA [36,] 2316.1 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/www/html/rcomp/tmp/1654w1229887176.ps",horizontal=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/www/html/rcomp/tmp/2p0lr1229887176.ps",horizontal=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/www/html/rcomp/tmp/3ubj31229887176.ps",horizontal=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/www/html/rcomp/tmp/4zwnl1229887176.ps",horizontal=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,] 2404.9 2025.70 1931.90 2376.5 2091.70 2232.50 2355.80 2066.10 2014.4 [2,] 2404.9 2025.70 1931.90 2376.5 2091.70 2232.50 2355.80 2066.10 2014.4 [3,] 2718.9 2328.25 2391.65 2703.1 2474.05 2565.85 2570.35 2415.15 2392.2 [4,] 3032.9 2630.80 2851.40 3029.7 2856.40 2899.20 2784.90 2764.20 2770.0 [5,] 3032.9 2630.80 2851.40 3029.7 2856.40 2899.20 2784.90 2764.20 2770.0 [,10] [,11] [,12] [,13] [,14] [,15] [,16] [,17] [,18] [,19] [1,] 2330.4 2198.20 2287 2371.4 1872.40 1983.8 2285.6 1965.00 2213 2246.30 [2,] 2330.4 2198.20 2287 2371.4 1872.40 1983.8 2285.6 1965.00 2213 2246.30 [3,] 2333.0 2449.55 2614 2430.3 2125.35 2194.2 2473.5 2262.15 2322 2458.25 [4,] 2335.6 2700.90 2941 2489.2 2378.30 2404.6 2661.4 2559.30 2431 2670.20 [5,] 2335.6 2700.90 2941 2489.2 2378.30 2404.6 2661.4 2559.30 2431 2670.20 [,20] [,21] [,22] [,23] [,24] [,25] [,26] [,27] [,28] [,29] [1,] 1889.4 1907.40 1955.1 1863.60 2161.50 2423.8 2262.3 2190.8 2606.3 2547.9 [2,] 1889.4 1907.40 1955.1 1863.60 2161.50 2423.8 2262.3 2190.8 2606.3 2547.9 [3,] 2111.6 2174.65 2085.5 2173.25 2340.95 2423.8 2262.3 2190.8 2606.3 2547.9 [4,] 2333.8 2441.90 2215.9 2482.90 2520.40 2423.8 2262.3 2190.8 2606.3 2547.9 [5,] 2333.8 2441.90 2215.9 2482.90 2520.40 2423.8 2262.3 2190.8 2606.3 2547.9 [,30] [,31] [,32] [,33] [,34] [,35] [,36] [1,] 2281.4 2594.1 2174.8 2158.6 2282.5 2368.1 2316.1 [2,] 2281.4 2594.1 2174.8 2158.6 2282.5 2368.1 2316.1 [3,] 2281.4 2594.1 2174.8 2158.6 2282.5 2368.1 2316.1 [4,] 2281.4 2594.1 2174.8 2158.6 2282.5 2368.1 2316.1 [5,] 2281.4 2594.1 2174.8 2158.6 2282.5 2368.1 2316.1 $n [1] 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 2017.280 1652.215 1364.358 1973.326 1619.705 1820.994 2090.947 1635.213 [2,] 3420.520 3004.285 3418.942 3432.874 3328.395 3310.706 3049.753 3195.087 [,9] [,10] [,11] [,12] [,13] [,14] [,15] [,16] [1,] 1548.022 2327.190 1887.919 1883.332 2298.690 1560.144 1724.07 2053.645 [2,] 3236.378 2338.810 3011.181 3344.668 2561.910 2690.556 2664.33 2893.355 [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [1,] 1598.181 2078.444 1984.657 1615.104 1577.491 1794.127 1481.350 1939.977 [2,] 2926.119 2565.556 2931.843 2608.096 2771.809 2376.873 2865.150 2741.923 [,25] [,26] [,27] [,28] [,29] [,30] [,31] [,32] [,33] [,34] [1,] 2423.8 2262.3 2190.8 2606.3 2547.9 2281.4 2594.1 2174.8 2158.6 2282.5 [2,] 2423.8 2262.3 2190.8 2606.3 2547.9 2281.4 2594.1 2174.8 2158.6 2282.5 [,35] [,36] [1,] 2368.1 2316.1 [2,] 2368.1 2316.1 $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" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "30" [31] "31" "32" "33" "34" "35" "36" Warning message: In bxp(list(stats = c(2404.9, 2404.9, 2718.9, 3032.9, 3032.9, 2025.7, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/5h76h1229887176.ps",horizontal=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] [1,] 2158.60 1863.60 [2,] 2334.70 1960.05 [3,] 2504.80 2126.60 [4,] 2732.55 2286.30 [5,] 3032.90 2404.90 $n [1] 36 24 $conf [,1] [,2] [1,] 2400.033 2021.379 [2,] 2609.567 2231.821 $out numeric(0) $group numeric(0) $names [1] "1" NA > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/6ede51229887176.ps",horizontal=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,] 2085.500 2085.500 2085.500 [2,] 2228.175 2228.175 2228.175 [3,] 2354.525 2354.525 2354.525 [4,] 2473.775 2473.775 2473.775 [5,] 2718.900 2718.900 2718.900 $n [1] 36 36 36 $conf [,1] [,2] [,3] [1,] 2289.850 2289.850 2289.850 [2,] 2419.200 2419.200 2419.200 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" > dev.off() null device 1 > > system("convert tmp/1654w1229887176.ps tmp/1654w1229887176.png") > system("convert tmp/2p0lr1229887176.ps tmp/2p0lr1229887176.png") > system("convert tmp/3ubj31229887176.ps tmp/3ubj31229887176.png") > system("convert tmp/4zwnl1229887176.ps tmp/4zwnl1229887176.png") > system("convert tmp/5h76h1229887176.ps tmp/5h76h1229887176.png") > system("convert tmp/6ede51229887176.ps tmp/6ede51229887176.png") > > > proc.time() user system elapsed 1.132 0.845 1.413