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. Natural language support but running in an English locale 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(97,100.7,101.4,101.5,101.8,101.5,102.2,101.8,98.5,98.4,97.5,97.7,98.3,99.6,99.4,96.7,96.9,96.1,97.9,99.2,97.8,94.9,93.3,91.5,89.1,92.3,91.8,92.1,94.4,92.8,92.6,92.3,92.1,89.8,87.4,87.7,86.3,89.1,90.4,87.1,86.7,84.4,88.4,88.9,88.5,87.2,86.2,83.4,87.5,85.7,87.4,86.8,87.9,85.9,87.7,87,86.8,86.2,86.1,87.5,85.7,88.9,89.8,91.4,95.2,94.1,96.8,96.1,96.6,94.2,93.9,96.5,93.4,95,95.2,94,97,96.9,96.3,96.3,97.3,95.7,96.4,95.1,94.6,95.9,96.2,94.3,98.3,95.9,92.1,94.6,94.7,96.7,97.5,96.2,97.1,95.9,94.5,99.4,101.3,101.4,100.9,101.4,103.1,102.4,101.1,102,103.9,101.7,101.2,101.9,101.1,103.1,103.3,101.4,102.8,103,102.6,102.2) > 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] [,12] [,13] [1,] 97.0 101.8 98.5 98.3 96.9 97.8 89.1 94.4 92.1 86.3 86.7 88.5 87.5 [2,] 100.7 101.5 98.4 99.6 96.1 94.9 92.3 92.8 89.8 89.1 84.4 87.2 85.7 [3,] 101.4 102.2 97.5 99.4 97.9 93.3 91.8 92.6 87.4 90.4 88.4 86.2 87.4 [4,] 101.5 101.8 97.7 96.7 99.2 91.5 92.1 92.3 87.7 87.1 88.9 83.4 86.8 [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25] [1,] 87.9 86.8 85.7 95.2 96.6 93.4 97.0 97.3 94.6 98.3 94.7 97.1 [2,] 85.9 86.2 88.9 94.1 94.2 95.0 96.9 95.7 95.9 95.9 96.7 95.9 [3,] 87.7 86.1 89.8 96.8 93.9 95.2 96.3 96.4 96.2 92.1 97.5 94.5 [4,] 87.0 87.5 91.4 96.1 96.5 94.0 96.3 95.1 94.3 94.6 96.2 99.4 [,26] [,27] [,28] [,29] [,30] [1,] 101.3 103.1 103.9 101.1 102.8 [2,] 101.4 102.4 101.7 103.1 103.0 [3,] 100.9 101.1 101.2 103.3 102.6 [4,] 101.4 102.0 101.9 101.4 102.2 > 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] 100.150 101.825 98.025 98.500 97.525 94.375 91.325 93.025 89.250 [10] 88.225 87.100 86.325 86.850 87.125 86.650 88.950 95.550 95.300 [19] 94.400 96.625 96.125 95.250 95.225 96.275 96.725 101.250 102.150 [28] 102.175 102.225 102.650 > arr.sd [1] 2.1299452 0.2872281 0.4991660 1.3291601 1.3375973 2.6725456 1.4974979 [8] 0.9394147 2.1794495 1.8679311 2.0314199 2.1654484 0.8266398 0.9032349 [15] 0.6454972 2.4006943 1.1676187 1.4491377 0.8485281 0.3774917 0.9464847 [22] 0.9398581 2.5863423 1.1786291 2.0758532 0.2380476 0.8346656 1.1870833 [29] 1.1354148 0.3415650 > arr.range [1] 4.5 0.7 1.0 2.9 3.1 6.3 3.2 2.1 4.7 4.1 4.5 5.1 1.8 2.0 1.4 5.7 2.7 2.7 1.8 [20] 0.7 2.2 1.9 6.2 2.8 4.9 0.5 2.0 2.7 2.2 0.8 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean 6.06006 -0.05015 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) 21.893 -4.792 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean 13.8931 -0.1158 > postscript(file="/var/www/html/freestat/rcomp/tmp/1oi7e1291813850.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/freestat/rcomp/tmp/2oi7e1291813850.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/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/39j521291813850.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/freestat/rcomp/tmp/4u1m81291813850.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/freestat/rcomp/tmp/5gk2w1291813850.tab") > > try(system("convert tmp/1oi7e1291813850.ps tmp/1oi7e1291813850.png",intern=TRUE)) character(0) > try(system("convert tmp/2oi7e1291813850.ps tmp/2oi7e1291813850.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.824 0.419 0.897