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(493395.00,487190.00,519493.00,519453.00,538588.00,438224.00,542034.00,512027.00,619880.00,533737.00,573789.00,589213.00,532168.00,551102.00,593789.00,527106.00,547327.00,601305.00,610872.00,601325.00,642143.00,614216.00,657979.00,673098.00,602297.00,615381.00,703671.00,733852.00,716596.00,745798.00,742027.10,679181.20,739022.70,645410.60,729382.10,671052.70,744954.80,677639.30,778207.20,763316.20,658531.60,831700.10,664156.30,621402.10,683588.70,600023.80,643273.80,653615.90,620177.50,574128.80,599828.00,599369.40,596617.70,616114.60,510226.90,493960.10,634503.30,588556.20,603239.00,617458.20,646543.50,680125.60,731595.80,759600.30,785031.70,849573.30,762342.00,815346.60,929603.20,784057.50,944667.70,1007258.30,664292.70,873207.40,1146510.00,1417266.80,1089387.90,1373379.70,1009397.60,818175.10,1003458.10,961142.70,1121906.60,1141713.30,1042352.60,992223.60,920525.30,1076093.40,967880.40,1236416.10) > 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] 90 > (np <- floor(n / par1)) [1] 7 > 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] [1,] 493395 532168 602297.0 744954.8 620177.5 646543.5 664292.7 [2,] 487190 551102 615381.0 677639.3 574128.8 680125.6 873207.4 [3,] 519493 593789 703671.0 778207.2 599828.0 731595.8 1146510.0 [4,] 519453 527106 733852.0 763316.2 599369.4 759600.3 1417266.8 [5,] 538588 547327 716596.0 658531.6 596617.7 785031.7 1089387.9 [6,] 438224 601305 745798.0 831700.1 616114.6 849573.3 1373379.7 [7,] 542034 610872 742027.1 664156.3 510226.9 762342.0 1009397.6 [8,] 512027 601325 679181.2 621402.1 493960.1 815346.6 818175.1 [9,] 619880 642143 739022.7 683588.7 634503.3 929603.2 1003458.1 [10,] 533737 614216 645410.6 600023.8 588556.2 784057.5 961142.7 [11,] 573789 657979 729382.1 643273.8 603239.0 944667.7 1121906.6 [12,] 589213 673098 671052.7 653615.9 617458.2 1007258.3 1141713.3 > 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] 530585.2 596035.8 693639.3 693367.5 587848.3 807978.8 1051653.2 > arr.sd [1] 48496.13 48368.70 50593.56 70245.82 43187.14 108182.17 215185.52 > arr.range [1] 181656.0 145992.0 143501.0 231676.3 140543.2 360714.8 752974.1 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean -1.568e+05 3.390e-01 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) -21.260 2.411 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean -563830.31 1.19 > postscript(file="/var/www/html/rcomp/tmp/1rh171243944443.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/245au1243944443.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/3sj511243944443.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/4vdwh1243944443.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/5lqhp1243944443.tab") > > system("convert tmp/1rh171243944443.ps tmp/1rh171243944443.png") > system("convert tmp/245au1243944443.ps tmp/245au1243944443.png") > > > proc.time() user system elapsed 0.512 0.278 0.694