R version 2.15.2 (2012-10-26) -- "Trick or Treat" Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 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(1021.3 + ,1039.79 + ,938.12 + ,947.36 + ,956.6 + ,956.6 + ,942.74 + ,951.98 + ,919.63 + ,901.15 + ,887.28 + ,836.45 + ,841.07 + ,836.45 + ,831.83 + ,817.97 + ,771.75 + ,707.05 + ,716.3 + ,725.54 + ,716.3 + ,707.05 + ,716.3 + ,780.99 + ,859.56 + ,961.22 + ,938.12 + ,988.95 + ,910.39 + ,901.15 + ,896.53 + ,910.39 + ,988.95 + ,988.95 + ,965.85 + ,975.09 + ,1002.82 + ,1025.92 + ,1081.38 + ,1164.56 + ,1201.53 + ,1229.26 + ,1275.47 + ,1275.47 + ,1307.82 + ,1252.36 + ,1261.61 + ,1340.17 + ,1414.11 + ,1409.49 + ,1432.59 + ,1520.4 + ,1529.64 + ,1455.7 + ,1427.97 + ,1538.88 + ,1612.82 + ,1635.93 + ,1603.58 + ,1589.72 + ,1557.37 + ,1589.72 + ,1668.28 + ,1635.93 + ,1615.68 + ,1644.69 + ,1622.71 + ,1626.11 + ,1705.55 + ,1841.35 + ,2029.03 + ,2024.21 + ,1952.87 + ,2153.06 + ,2339.29 + ,2502.89 + ,2515.37 + ,2445.68 + ,2491.11 + ,2691.32 + ,2651.8 + ,2593.49 + ,2697.23 + ,2751.63 + ,2713.9 + ,2747.21 + ,2982.32 + ,3063.39 + ,3058.7 + ,3074.38 + ,3341.06 + ,3500.03 + ,392.88 + ,3071.52 + ,2516.41 + ,2350.7 + ,2488.68 + ,2872.65 + ,3220.21 + ,3078.04 + ,3043.98 + ,3134.34 + ,3141.85 + ,3128.01 + ,3241.16 + ,3389.48 + ,3406.36 + ,3449.84 + ,3606.24 + ,3653.99 + ,3607.31 + ,3712.52 + ,3803.47 + ,3806.33 + ,3768.4 + ,3952.06 + ,4134.85 + ,4060.9 + ,3999.88 + ,4004.03 + ,3977.34 + ,3650.08 + ,3708.85 + ,3764.78 + ,3761.86 + ,3802.55 + ,3773.52 + ,3428.7 + ,3194.21 + ,3095.56 + ,3064.85 + ,3022.98 + ,2887.66 + ,3178.86 + ,3438.47 + ,3493.87 + ,3421.89 + ,3390.28 + ,3319.24 + ,3287.84 + ,3222.82 + ,3182.69 + ,3180.21 + ,3116.34 + ,3297.46 + ,3357.48 + ,3386.03 + ,3319.45 + ,3363.59 + ,3303.47 + ,3210.55 + ,3050.27 + ,3010.55 + ,3011.65 + ,3104.98 + ,3087.85 + ,3160.16 + ,3319.22 + ,3432.49 + ,3475.68 + ,3347.48 + ,3388.81 + ,3610.23 + ,3691.45 + ,3587.86 + ,3704.62 + ,3798.75 + ,3956.54 + ,4121.94 + ,4148.56 + ,4100.37 + ,4060.71 + ,4147.86 + ,3926.61 + ,3865.41 + ,3978.57 + ,3851.95 + ,3701.22 + ,3738.65 + ,3766.9 + ,3711.02 + ,3675.22 + ,3560.53 + ,3723.8 + ,3914.27 + ,3870.77 + ,3924.36 + ,3968.89 + ,3982.93 + ,3917.09 + ,3969.18 + ,4149.81 + ,4406.88 + ,423.82 + ,417.72 + ,4527.16 + ,4617.39 + ,4656.23 + ,4579.9 + ,4652.4 + ,4722.95 + ,4845.81 + ,4975.21 + ,5083.64 + ,5378.04 + ,5684.44 + ,5841.87 + ,5857.23 + ,6174.52 + ,6413.17 + ,6780.11 + ,6524.94 + ,6466.7 + ,6495.61 + ,6399.52 + ,6729.98 + ,7060.77 + ,7423.27 + ,8069.17 + ,8650.68 + ,8938.07 + ,9482.08 + ,10225.26 + ,9390.27 + ,8546.11 + ,8073.77 + ,8655.31 + ,9150.1 + ,9775.81 + ,9785.14 + ,9363.44 + ,9304.18 + ,9030.26 + ,8920.8 + ,8606.08 + ,8353.75 + ,8615.63 + ,8128.64 + ,8715.94 + ,8500.8 + ,8142.58 + ,7614.66 + ,7558.95 + ,7820.75 + ,7828.9 + ,7904.59 + ,8140.97 + ,8483.01 + ,8322.68 + ,8268.01 + ,8402.05 + ,8177.78 + ,7950.54 + ,8049.94 + ,7674.13 + ,7666.36 + ,7570.18 + ,7694.45 + ,7810.64 + ,7748.43 + ,7040.64 + ,7077.26 + ,7245.51 + ,7289.12 + ,7486.92 + ,7519.88 + ,7554.84 + ,7780.89 + ,7748.09 + ,7152.25 + ,6484.66 + ,6254.58 + ,5867.32 + ,5544.16 + ,5822.74 + ,5690.63 + ,5564.78 + ,5088.39 + ,4784.22 + ,5332.46 + ,5541.48 + ,5723.92 + ,5736.99 + ,5992.07 + ,6091.43 + ,6158.17 + ,6303.79 + ,6349.71 + ,6802.96 + ,7132.68 + ,7073.29 + ,7264.5 + ,7105.33 + ,7218.71 + ,7225.72 + ,7354.25 + ,7745.46 + ,8070.26 + ,8366.33 + ,8667.51 + ,8854.34 + ,9218.1 + ,9332.9 + ,9358.31 + ,9248.66 + ,9401.2 + ,9652.04 + ,9957.38 + ,10110.63 + ,10169.26 + ,10343.78 + ,10750.21 + ,11337.5 + ,11786.96 + ,12083.04 + ,12007.74 + ,11745.93 + ,11051.51 + ,11445.9 + ,11924.88 + ,12247.63 + ,12690.91 + ,12910.7 + ,13202.12 + ,13654.67 + ,13862.82 + ,13523.93 + ,14211.17 + ,14510.35 + ,14289.23 + ,14111.82 + ,13086.59 + ,13351.54 + ,13747.69 + ,12855.61 + ,12926.93 + ,12121.95 + ,11731.65 + ,11639.51 + ,12163.78 + ,12029.53 + ,11234.18 + ,9852.13 + ,9709.04 + ,9332.75 + ,7108.6 + ,6691.49 + ,6143.05 + ,6379.15 + ,5994.58 + ,5607.94 + ,6046.13 + ,6624.96 + ,6652.54 + ,6696 + ,7315.16 + ,7907.79 + ,8066.35 + ,7939.64 + ,8068.48 + ,8186.33 + ,7975.21 + ,8357.51 + ,8463.38 + ,7937.68 + ,8034.62 + ,8056.61 + ,8176.95 + ,8441.04 + ,8697.39 + ,8665.57 + ,8625.77 + ,8718.42 + ,8822.34 + ,8597.67 + ,8782.05 + ,8661.06 + ,8265.32 + ,8072.58 + ,721.85 + ,7138.6 + ,7351.11 + ,7077 + ,7272.37 + ,7577.84) > par1 = '12' > par1 <- '12' > #'GNU S' R Code compiled by R2WASP v. 1.2.291 () > #Author: root > #To cite this work: Wessa P. (2012), Standard Deviation-Mean Plot (v1.0.6) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_smp.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > # > par1 <- as.numeric(par1) > (n <- length(x)) [1] 385 > (np <- floor(n / par1)) [1] 32 > arr <- array(NA,dim=c(par1,np)) > j <- 0 > k <- 1 > for (i in 1:(np*par1)) + { + j = j + 1 + arr[j,k] <- x[i] + if (j == par1) { + j = 0 + k=k+1 + } + } > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 1021.30 841.07 859.56 1002.82 1414.11 1557.37 1952.87 2713.90 2488.68 [2,] 1039.79 836.45 961.22 1025.92 1409.49 1589.72 2153.06 2747.21 2872.65 [3,] 938.12 831.83 938.12 1081.38 1432.59 1668.28 2339.29 2982.32 3220.21 [4,] 947.36 817.97 988.95 1164.56 1520.40 1635.93 2502.89 3063.39 3078.04 [5,] 956.60 771.75 910.39 1201.53 1529.64 1615.68 2515.37 3058.70 3043.98 [6,] 956.60 707.05 901.15 1229.26 1455.70 1644.69 2445.68 3074.38 3134.34 [7,] 942.74 716.30 896.53 1275.47 1427.97 1622.71 2491.11 3341.06 3141.85 [8,] 951.98 725.54 910.39 1275.47 1538.88 1626.11 2691.32 3500.03 3128.01 [9,] 919.63 716.30 988.95 1307.82 1612.82 1705.55 2651.80 392.88 3241.16 [10,] 901.15 707.05 988.95 1252.36 1635.93 1841.35 2593.49 3071.52 3389.48 [11,] 887.28 716.30 965.85 1261.61 1603.58 2029.03 2697.23 2516.41 3406.36 [12,] 836.45 780.99 975.09 1340.17 1589.72 2024.21 2751.63 2350.70 3449.84 [,10] [,11] [,12] [,13] [,14] [,15] [,16] [,17] [,18] [1,] 3606.24 3977.34 2887.66 3297.46 3160.16 4121.94 3711.02 4406.88 5378.04 [2,] 3653.99 3650.08 3178.86 3357.48 3319.22 4148.56 3675.22 423.82 5684.44 [3,] 3607.31 3708.85 3438.47 3386.03 3432.49 4100.37 3560.53 417.72 5841.87 [4,] 3712.52 3764.78 3493.87 3319.45 3475.68 4060.71 3723.80 4527.16 5857.23 [5,] 3803.47 3761.86 3421.89 3363.59 3347.48 4147.86 3914.27 4617.39 6174.52 [6,] 3806.33 3802.55 3390.28 3303.47 3388.81 3926.61 3870.77 4656.23 6413.17 [7,] 3768.40 3773.52 3319.24 3210.55 3610.23 3865.41 3924.36 4579.90 6780.11 [8,] 3952.06 3428.70 3287.84 3050.27 3691.45 3978.57 3968.89 4652.40 6524.94 [9,] 4134.85 3194.21 3222.82 3010.55 3587.86 3851.95 3982.93 4722.95 6466.70 [10,] 4060.90 3095.56 3182.69 3011.65 3704.62 3701.22 3917.09 4845.81 6495.61 [11,] 3999.88 3064.85 3180.21 3104.98 3798.75 3738.65 3969.18 4975.21 6399.52 [12,] 4004.03 3022.98 3116.34 3087.85 3956.54 3766.90 4149.81 5083.64 6729.98 [,19] [,20] [,21] [,22] [,23] [,24] [,25] [,26] [1,] 7060.77 9775.81 8142.58 7950.54 7486.92 5564.78 6802.96 8854.34 [2,] 7423.27 9785.14 7614.66 8049.94 7519.88 5088.39 7132.68 9218.10 [3,] 8069.17 9363.44 7558.95 7674.13 7554.84 4784.22 7073.29 9332.90 [4,] 8650.68 9304.18 7820.75 7666.36 7780.89 5332.46 7264.50 9358.31 [5,] 8938.07 9030.26 7828.90 7570.18 7748.09 5541.48 7105.33 9248.66 [6,] 9482.08 8920.80 7904.59 7694.45 7152.25 5723.92 7218.71 9401.20 [7,] 10225.26 8606.08 8140.97 7810.64 6484.66 5736.99 7225.72 9652.04 [8,] 9390.27 8353.75 8483.01 7748.43 6254.58 5992.07 7354.25 9957.38 [9,] 8546.11 8615.63 8322.68 7040.64 5867.32 6091.43 7745.46 10110.63 [10,] 8073.77 8128.64 8268.01 7077.26 5544.16 6158.17 8070.26 10169.26 [11,] 8655.31 8715.94 8402.05 7245.51 5822.74 6303.79 8366.33 10343.78 [12,] 9150.10 8500.80 8177.78 7289.12 5690.63 6349.71 8667.51 10750.21 [,27] [,28] [,29] [,30] [,31] [,32] [1,] 11337.50 13654.67 12121.95 6379.15 8186.33 8718.42 [2,] 11786.96 13862.82 11731.65 5994.58 7975.21 8822.34 [3,] 12083.04 13523.93 11639.51 5607.94 8357.51 8597.67 [4,] 12007.74 14211.17 12163.78 6046.13 8463.38 8782.05 [5,] 11745.93 14510.35 12029.53 6624.96 7937.68 8661.06 [6,] 11051.51 14289.23 11234.18 6652.54 8034.62 8265.32 [7,] 11445.90 14111.82 9852.13 6696.00 8056.61 8072.58 [8,] 11924.88 13086.59 9709.04 7315.16 8176.95 721.85 [9,] 12247.63 13351.54 9332.75 7907.79 8441.04 7138.60 [10,] 12690.91 13747.69 7108.60 8066.35 8697.39 7351.11 [11,] 12910.70 12855.61 6691.49 7939.64 8665.57 7077.00 [12,] 13202.12 12926.93 6143.05 8068.48 8625.77 7272.37 > arr.mean <- array(NA,dim=np) > arr.sd <- array(NA,dim=np) > arr.range <- array(NA,dim=np) > for (j in 1:np) + { + arr.mean[j] <- mean(arr[,j],na.rm=TRUE) + arr.sd[j] <- sd(arr[,j],na.rm=TRUE) + arr.range[j] <- max(arr[,j],na.rm=TRUE) - min(arr[,j],na.rm=TRUE) + } > arr.mean [1] 941.5833 764.0500 940.4292 1201.5308 1514.2358 1713.3858 [7] 2482.1450 2734.3750 3132.8833 3842.4983 3520.4400 3260.0142 [13] 3208.6108 3539.4408 3950.7292 3863.9892 3992.4258 6228.8442 [19] 8638.7383 8925.0392 8055.4108 7568.1000 6742.2467 5722.2842 [25] 7502.2500 9699.7342 12036.2350 13677.6958 9979.8050 6941.5600 [31] 8301.5050 7456.6975 > arr.sd [1] 54.54253 55.46727 43.86188 110.59445 84.00342 162.49531 [7] 236.56621 805.45734 261.84309 182.88527 340.19748 168.84555 [13] 146.24253 226.90669 165.47947 164.51639 1678.78835 441.54588 [19] 892.60131 538.71988 304.41874 331.34339 880.83801 488.25547 [25] 579.08117 561.38073 644.23958 547.63524 2240.99735 886.35738 [31] 276.67565 2228.89340 > arr.range [1] 203.34 134.02 129.39 337.35 226.44 471.66 798.76 3107.15 961.16 [10] 528.61 954.36 606.21 375.48 796.38 447.34 589.28 4665.92 1402.07 [19] 3164.49 1656.50 924.06 1009.30 2236.73 1565.49 1864.55 1895.87 2150.61 [28] 1654.74 6020.73 2460.54 759.71 8100.49 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean 115.34518 0.07578 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) -2.666 1.013 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean 390.6918 0.2307 > postscript(file="/var/wessaorg/rcomp/tmp/1j8ya1355694625.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(arr.mean,arr.sd,main='Standard Deviation-Mean Plot',xlab='mean',ylab='standard deviation') > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/2p1vb1355694625.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(arr.mean,arr.range,main='Range-Mean Plot',xlab='mean',ylab='range') > dev.off() null device 1 > > #Note: the /var/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/wessaorg/rcomp/createtable") > > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,'Standard Deviation-Mean Plot',4,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Section',header=TRUE) > a<-table.element(a,'Mean',header=TRUE) > a<-table.element(a,'Standard Deviation',header=TRUE) > a<-table.element(a,'Range',header=TRUE) > a<-table.row.end(a) > for (j in 1:np) { + a<-table.row.start(a) + a<-table.element(a,j,header=TRUE) + a<-table.element(a,arr.mean[j]) + a<-table.element(a,arr.sd[j] ) + a<-table.element(a,arr.range[j] ) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/wessaorg/rcomp/tmp/3q6rp1355694625.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,'Regression: S.E.(k) = alpha + beta * Mean(k)',2,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'alpha',header=TRUE) > a<-table.element(a,lm1$coefficients[[1]]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'beta',header=TRUE) > a<-table.element(a,lm1$coefficients[[2]]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'S.D.',header=TRUE) > a<-table.element(a,summary(lm1)$coefficients[2,2]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'T-STAT',header=TRUE) > a<-table.element(a,summary(lm1)$coefficients[2,3]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'p-value',header=TRUE) > a<-table.element(a,summary(lm1)$coefficients[2,4]) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/wessaorg/rcomp/tmp/4u8s21355694625.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,'Regression: ln S.E.(k) = alpha + beta * ln Mean(k)',2,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'alpha',header=TRUE) > a<-table.element(a,lnlm1$coefficients[[1]]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'beta',header=TRUE) > a<-table.element(a,lnlm1$coefficients[[2]]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'S.D.',header=TRUE) > a<-table.element(a,summary(lnlm1)$coefficients[2,2]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'T-STAT',header=TRUE) > a<-table.element(a,summary(lnlm1)$coefficients[2,3]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'p-value',header=TRUE) > a<-table.element(a,summary(lnlm1)$coefficients[2,4]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Lambda',header=TRUE) > a<-table.element(a,1-lnlm1$coefficients[[2]]) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/wessaorg/rcomp/tmp/5vegt1355694625.tab") > > try(system("convert tmp/1j8ya1355694625.ps tmp/1j8ya1355694625.png",intern=TRUE)) character(0) > try(system("convert tmp/2p1vb1355694625.ps tmp/2p1vb1355694625.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.274 0.569 2.883