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. 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(1.5421,1.5642,1.5827,1.5878,1.5703,1.5968,1.5978,1.5575,1.5749,1.6176,1.6387,1.6422,1.6891,1.7236,1.8072,1.7847,1.6813,1.6469,1.689,1.7169,1.8036,1.7955,1.7172,1.7348,1.7094,1.6963,1.6695,1.6537,1.6662,1.6793,1.7922,1.8045,1.7927,1.7831,1.7847,1.8076,1.8218,1.8112,1.795,1.7813,1.7866,1.7552,1.7184,1.7114,1.6967,1.6867,1.6337,1.6626,1.6374,1.626,1.637,1.6142,1.7033,1.7483,1.7135,1.7147,1.7396,1.7049,1.6867,1.7462,1.7147,1.667,1.6806,1.6738,1.6571,1.5875,1.6002,1.6144,1.6009,1.5937,1.603,1.5979,1.6152,1.6102,1.654,1.6662,1.6715,1.7104,1.6869,1.6788,1.6839,1.6733,1.6684,1.6814,1.6602,1.6708,1.6704,1.6336,1.6378,1.593,1.5809,1.6442,1.6445,1.5837,1.6373,1.6703,1.6694) > 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] 97 > (np <- floor(n / par1)) [1] 24 > 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,] 1.5421 1.5703 1.5749 1.6891 1.6813 1.8036 1.7094 1.6662 1.7927 1.8218 [2,] 1.5642 1.5968 1.6176 1.7236 1.6469 1.7955 1.6963 1.6793 1.7831 1.8112 [3,] 1.5827 1.5978 1.6387 1.8072 1.6890 1.7172 1.6695 1.7922 1.7847 1.7950 [4,] 1.5878 1.5575 1.6422 1.7847 1.7169 1.7348 1.6537 1.8045 1.8076 1.7813 [,11] [,12] [,13] [,14] [,15] [,16] [,17] [,18] [,19] [,20] [1,] 1.7866 1.6967 1.6374 1.7033 1.7396 1.7147 1.6571 1.6009 1.6152 1.6715 [2,] 1.7552 1.6867 1.6260 1.7483 1.7049 1.6670 1.5875 1.5937 1.6102 1.7104 [3,] 1.7184 1.6337 1.6370 1.7135 1.6867 1.6806 1.6002 1.6030 1.6540 1.6869 [4,] 1.7114 1.6626 1.6142 1.7147 1.7462 1.6738 1.6144 1.5979 1.6662 1.6788 [,21] [,22] [,23] [,24] [1,] 1.6839 1.6602 1.6378 1.6445 [2,] 1.6733 1.6708 1.5930 1.5837 [3,] 1.6684 1.6704 1.5809 1.6373 [4,] 1.6814 1.6336 1.6442 1.6703 > 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] 1.569200 1.580600 1.618350 1.751150 1.683525 1.762775 1.682225 1.735550 [9] 1.792025 1.802325 1.742900 1.669925 1.628650 1.719950 1.719350 1.684025 [17] 1.614800 1.598875 1.636400 1.686900 1.676750 1.658750 1.613975 1.633950 > arr.sd [1] 0.020717304 0.019983160 0.030937625 0.054394883 0.028810921 0.043194473 [7] 0.025246699 0.072885321 0.011200409 0.017830194 0.034897373 0.028072570 [13] 0.010986507 0.019579837 0.028318486 0.021190308 0.030264941 0.004035158 [19] 0.027890739 0.016882140 0.007173330 0.017469497 0.031702195 0.036372655 > arr.range [1] 0.0457 0.0403 0.0673 0.1181 0.0700 0.0864 0.0557 0.1383 0.0245 0.0405 [11] 0.0752 0.0630 0.0232 0.0450 0.0595 0.0477 0.0696 0.0093 0.0560 0.0389 [21] 0.0155 0.0372 0.0633 0.0866 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean -0.07934 0.06319 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) -5.739 3.777 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean -0.1503 0.1238 > postscript(file="/var/www/html/rcomp/tmp/1fafl1228294369.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/2vmz31228294369.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/3x07h1228294369.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/4tnm41228294369.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/5vect1228294369.tab") > > system("convert tmp/1fafl1228294369.ps tmp/1fafl1228294369.png") > system("convert tmp/2vmz31228294369.ps tmp/2vmz31228294369.png") > > > proc.time() user system elapsed 0.508 0.297 0.871