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(8.5968,8.5114,8.3884,8.2671,8.2410,8.3177,8.4070,8.3917,8.4145,8.5245,8.6289,8.6622,8.9055,8.9770,9.1264,9.1120,9.0576,9.2106,9.2637,9.3107,9.6744,9.5780,9.4166,9.4359,9.2275,9.1828,9.0594,9.1358,9.2208,9.1137,9.2689,9.2489,9.1679,9.1051,9.0818,9.0961,9.1733,9.1455,9.2265,9.1541,9.1559,9.1182,9.1856,9.2378,9.0682,9.0105,8.9939,9.0228,9.1368,9.1763,9.2346,9.1653,9.1277,9.1430,9.1962,9.1861,9.0920,9.0620,8.9981,8.9819,9.0476,9.0852,9.0884,9.1670,9.1931,9.2628,9.4276,9.3398,9.3342,9.4223,9.5614,9.4316,9.3111,9.3414,9.4017,9.3346,9.3310,9.2349,9.2170,9.2098,9.2665,9.2533,9.1008,9.0377,9.0795,9.1896,9.2992,9.2372,9.2061,9.3290,9.1842,9.3231,9.2835,9.1735,9.2889,9.4319) > 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] 96 > (np <- floor(n / par1)) [1] 8 > 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] [1,] 8.5968 8.9055 9.2275 9.1733 9.1368 9.0476 9.3111 9.0795 [2,] 8.5114 8.9770 9.1828 9.1455 9.1763 9.0852 9.3414 9.1896 [3,] 8.3884 9.1264 9.0594 9.2265 9.2346 9.0884 9.4017 9.2992 [4,] 8.2671 9.1120 9.1358 9.1541 9.1653 9.1670 9.3346 9.2372 [5,] 8.2410 9.0576 9.2208 9.1559 9.1277 9.1931 9.3310 9.2061 [6,] 8.3177 9.2106 9.1137 9.1182 9.1430 9.2628 9.2349 9.3290 [7,] 8.4070 9.2637 9.2689 9.1856 9.1962 9.4276 9.2170 9.1842 [8,] 8.3917 9.3107 9.2489 9.2378 9.1861 9.3398 9.2098 9.3231 [9,] 8.4145 9.6744 9.1679 9.0682 9.0920 9.3342 9.2665 9.2835 [10,] 8.5245 9.5780 9.1051 9.0105 9.0620 9.4223 9.2533 9.1735 [11,] 8.6289 9.4166 9.0818 8.9939 8.9981 9.5614 9.1008 9.2889 [12,] 8.6622 9.4359 9.0961 9.0228 8.9819 9.4316 9.0377 9.4319 > 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] 8.445933 9.255700 9.159058 9.124358 9.125000 9.280083 9.253317 9.252142 > arr.sd [1] 0.13903742 0.23733298 0.07048473 0.08271696 0.07814924 0.16514483 0.10411285 [8] 0.09276786 > arr.range [1] 0.4212 0.7689 0.2095 0.2439 0.2527 0.5138 0.3640 0.3524 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean 0.080783 0.004438 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) -0.6144 -0.7147 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean -0.17920 0.06255 > postscript(file="/var/www/html/rcomp/tmp/1f9ig1244368359.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/2dins1244368359.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/3gtqo1244368359.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/4itu01244368359.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/58npu1244368360.tab") > > system("convert tmp/1f9ig1244368359.ps tmp/1f9ig1244368359.png") > system("convert tmp/2dins1244368359.ps tmp/2dins1244368359.png") > > > proc.time() user system elapsed 0.481 0.284 0.627