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(132.1,125,127.1,101.5,85.7,79.3,70.9,77.1,83.9,96.2,111.7,127.2,143.6,134.9,135.6,105.3,86.4,74.6,67.6,73.4,78.5,98.2,118.6,136.9,137.9,115.6,119.3,98.5,84.3,73.5,60.7,69.5,77.9,113.9,126.3,135.1,130.5,113.1,110,90.8,85.4,72.5,64.7,67.2,77.9,105.2,107.2,120.7,121.3,107.9,105.6,81.3,71.7,64.8,57.3,61.9,70.1,88.8,106.8,110.7,114.1,108,111.5,86.8,78.4,68,57.3,65.3,73.3,88.6,101.3,122.9,126.6,114.1,124.7,93.3,77.2,66.5,57.9,63.7,65.8,85,101,105.3,121,117.9,106,86.6,79.9,65.2,61.2,67.6,78.9,95.5,113.1,124.4,122,110.3,114,93.3,75.5,65.4,59.2,63.8,74.2,91.7,107,120.7,127.4,119.7,112.7,84.4,75.6,66.5,59.9,64.8,74.3,100.4,105.9,131.1) > par1 = '12' > #'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] 10 > 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] [1,] 132.1 143.6 137.9 130.5 121.3 114.1 126.6 121.0 122.0 127.4 [2,] 125.0 134.9 115.6 113.1 107.9 108.0 114.1 117.9 110.3 119.7 [3,] 127.1 135.6 119.3 110.0 105.6 111.5 124.7 106.0 114.0 112.7 [4,] 101.5 105.3 98.5 90.8 81.3 86.8 93.3 86.6 93.3 84.4 [5,] 85.7 86.4 84.3 85.4 71.7 78.4 77.2 79.9 75.5 75.6 [6,] 79.3 74.6 73.5 72.5 64.8 68.0 66.5 65.2 65.4 66.5 [7,] 70.9 67.6 60.7 64.7 57.3 57.3 57.9 61.2 59.2 59.9 [8,] 77.1 73.4 69.5 67.2 61.9 65.3 63.7 67.6 63.8 64.8 [9,] 83.9 78.5 77.9 77.9 70.1 73.3 65.8 78.9 74.2 74.3 [10,] 96.2 98.2 113.9 105.2 88.8 88.6 85.0 95.5 91.7 100.4 [11,] 111.7 118.6 126.3 107.2 106.8 101.3 101.0 113.1 107.0 105.9 [12,] 127.2 136.9 135.1 120.7 110.7 122.9 105.3 124.4 120.7 131.1 > 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] 101.47500 104.46667 101.04167 95.43333 87.35000 89.62500 90.09167 [8] 93.10833 91.42500 93.55833 > arr.sd [1] 22.40240 28.50121 27.08621 21.99869 22.30346 21.66795 24.38175 22.98163 [9] 23.22444 25.71326 > arr.range [1] 61.2 76.0 77.2 65.8 64.0 65.6 68.7 63.2 62.8 71.2 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean -0.1666 0.2553 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) -1.1905 0.9595 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean 20.3129 0.4987 > postscript(file="/var/www/html/rcomp/tmp/1plpi1291556935.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/www/html/rcomp/tmp/2zcol1291556935.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/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/3ld4r1291556935.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/4ov3x1291556935.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/5ae131291556935.tab") > > try(system("convert tmp/1plpi1291556935.ps tmp/1plpi1291556935.png",intern=TRUE)) character(0) > try(system("convert tmp/2zcol1291556935.ps tmp/2zcol1291556935.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.533 0.284 1.161