R version 2.9.0 (2009-04-17) Copyright (C) 2009 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(81.28,69.39,67.63,51.25,103.97,133.83,162.37,172.91,163.01,151.50,111.73,88.58,74.29,63.98,61.18,76.48,107.98,124.97,145.57,140.20,143.84,138.80,104.06,74.70,60.18,55.16,35.62,56.18,85.44,114.08,133.64,67.14,95.58,89.37,75.24,69.18,54.49,57.50,62.16,76.67,110.04,127.38,156.47,167.56,153.54,124.08,100.97,79.17,68.13,61.77,54.31,60.30,84.18,104.05,114.66,105.55,96.61,70.94,63.91,58.61,44.53,49.58,57.39,76.76,104.57,125.41,143.11,136.35,135.15,131.70,96.87,70.63,66.29,63.49,62.97,66.43,101.49,127.69,133.21,158.72,148.61,134.31,100.99,75.16,59.74,52.87,52.07,57.38,79.43,101.40,120.19,134.38,135.97,113.83,84.38,70.28,65.96,56.36,49.57,68.33,90.32,117.06,134.69,131.67,129.25,118.77,88.44,76.79,75.28,73.89,76.24,88.58,105.83,115.84,127.76,131.75,119.63,93.38,75.55,51.79) > par1 = '4' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > #Technical description: Write here your technical program description (don't use hard returns!) > par1 <- as.numeric(par1) > (n <- length(x)) [1] 120 > (np <- floor(n / par1)) [1] 30 > 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] [,10] [,11] [1,] 81.28 103.97 163.01 74.29 107.98 143.84 60.18 85.44 95.58 54.49 110.04 [2,] 69.39 133.83 151.50 63.98 124.97 138.80 55.16 114.08 89.37 57.50 127.38 [3,] 67.63 162.37 111.73 61.18 145.57 104.06 35.62 133.64 75.24 62.16 156.47 [4,] 51.25 172.91 88.58 76.48 140.20 74.70 56.18 67.14 69.18 76.67 167.56 [,12] [,13] [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [1,] 153.54 68.13 84.18 96.61 44.53 104.57 135.15 66.29 101.49 148.61 59.74 [2,] 124.08 61.77 104.05 70.94 49.58 125.41 131.70 63.49 127.69 134.31 52.87 [3,] 100.97 54.31 114.66 63.91 57.39 143.11 96.87 62.97 133.21 100.99 52.07 [4,] 79.17 60.30 105.55 58.61 76.76 136.35 70.63 66.43 158.72 75.16 57.38 [,23] [,24] [,25] [,26] [,27] [,28] [,29] [,30] [1,] 79.43 135.97 65.96 90.32 129.25 75.28 105.83 119.63 [2,] 101.40 113.83 56.36 117.06 118.77 73.89 115.84 93.38 [3,] 120.19 84.38 49.57 134.69 88.44 76.24 127.76 75.55 [4,] 134.38 70.28 68.33 131.67 76.79 88.58 131.75 51.79 > 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] 67.3875 143.2700 128.7050 68.9825 129.6800 115.3500 51.7850 100.0750 [9] 82.3425 62.7050 140.3625 114.4400 61.1275 102.1100 72.5175 57.0650 [17] 127.3600 108.5875 64.7950 130.2775 114.7675 55.5150 108.8500 101.1150 [25] 60.0550 118.4350 103.3125 78.4975 120.2950 85.0875 > arr.sd [1] 12.348944 30.967419 34.615080 7.534058 16.894147 32.359796 10.992268 [8] 29.561499 12.224485 9.830166 26.376472 31.870328 5.674824 12.839842 [15] 16.836911 14.155683 16.852984 30.647597 1.820430 23.473323 33.094802 [22] 3.660278 23.814669 29.481066 8.697373 20.262725 24.740806 6.790544 [29] 11.776056 28.645170 > arr.range [1] 30.03 68.94 74.43 15.30 37.59 69.14 24.56 66.50 26.40 22.18 57.52 74.37 [13] 13.82 30.48 38.00 32.23 38.54 64.52 3.46 57.23 73.45 7.67 54.95 65.69 [25] 18.76 44.37 52.46 14.69 25.92 67.84 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean -5.1368 0.2515 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) -4.584 1.623 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean -10.9614 0.5565 > postscript(file="/var/www/html/rcomp/tmp/1rwsp1274026994.ps",horizontal=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/www/html/rcomp/tmp/2rwsp1274026994.ps",horizontal=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/www/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/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/www/html/rcomp/tmp/3uwqd1274026994.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/www/html/rcomp/tmp/4gfp11274026994.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/www/html/rcomp/tmp/5cp5s1274026994.tab") > > try(system("convert tmp/1rwsp1274026994.ps tmp/1rwsp1274026994.png",intern=TRUE)) character(0) > try(system("convert tmp/2rwsp1274026994.ps tmp/2rwsp1274026994.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.521 0.292 0.896