R version 3.4.1 (2017-06-30) -- "Single Candle" Copyright (C) 2017 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-bit) 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. > source('/home/pw/wessanet/cretab') > > > > myrfcuid = '' > > x <- c(503334,503737,504101,504504,504894,505297,505687,506090,506493,506883,507286,507676,508079,508482,508846,509249,509639,510042,510432,510835,511238,511628,512031,512421,512824,513227,513604,514007,514397,514800,515190,515593,515996,516386,516789,517179,517582,517985,518349,518752,519142,519545,519935,520338,520741,521131,521534,521924,522327,522730,523094,523497,523887,524290,524680,525083,525486,525876,526279,526669,527072,527475,527839,528242,528632,529035,529425,529828,530231,530621,531024,531414,531817,532220,532597,533000,533390,533793,534183,534586,534989,535379,535782,536172,536575,536978,537342,537745,538135,538538,538928,539331,539734,540124,540527,540917,541320,541723,542087,542490,542880,543283,543673,544076,544479,544869,545272,545662) > par1 = '12' > par1 <- '12' > #'GNU S' R Code compiled by R2WASP v. 1.2.327 (Sat, 15 Jul 2017 00:11:16 +0200) > #Author: root > #To cite this work: Wessa P. (2017), Standard Deviation-Mean Plot (v1.0.7) in Free Statistics Software (v$_version), Office for Research Development and Education, URL https://www.wessa.net/rwasp_smp.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > # > par1 <- as.numeric(par1) > (n <- length(x)) [1] 108 > (np <- floor(n / par1)) [1] 9 > 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] [1,] 503334 508079 512824 517582 522327 527072 531817 536575 541320 [2,] 503737 508482 513227 517985 522730 527475 532220 536978 541723 [3,] 504101 508846 513604 518349 523094 527839 532597 537342 542087 [4,] 504504 509249 514007 518752 523497 528242 533000 537745 542490 [5,] 504894 509639 514397 519142 523887 528632 533390 538135 542880 [6,] 505297 510042 514800 519545 524290 529035 533793 538538 543283 [7,] 505687 510432 515190 519935 524680 529425 534183 538928 543673 [8,] 506090 510835 515593 520338 525083 529828 534586 539331 544076 [9,] 506493 511238 515996 520741 525486 530231 534989 539734 544479 [10,] 506883 511628 516386 521131 525876 530621 535379 540124 544869 [11,] 507286 512031 516789 521534 526279 531024 535782 540527 545272 [12,] 507676 512421 517179 521924 526669 531414 536172 540917 545662 > 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] 505498.5 510243.5 514999.3 519746.5 524491.5 529236.5 533992.3 538739.5 [9] 543484.5 > arr.sd [1] 1425.863 1425.863 1429.122 1425.863 1425.863 1425.863 1429.122 1425.863 [9] 1425.863 > arr.range [1] 4342 4342 4355 4342 4342 4342 4355 4342 4342 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean 1.427e+03 1.624e-08 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) 7.2616245 0.0001075 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean 4.345e+03 6.477e-08 > postscript(file="/home/pw/wessanet/rcomp/tmp/10zwg1502825152.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="/home/pw/wessanet/rcomp/tmp/2q4g11502825152.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 > > 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="/home/pw/wessanet/rcomp/tmp/3k2w51502825152.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="/home/pw/wessanet/rcomp/tmp/47csp1502825152.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="/home/pw/wessanet/rcomp/tmp/580ln1502825152.tab") > > try(system("convert /home/pw/wessanet/rcomp/tmp/10zwg1502825152.ps /home/pw/wessanet/rcomp/tmp/10zwg1502825152.png",intern=TRUE)) character(0) > try(system("convert /home/pw/wessanet/rcomp/tmp/2q4g11502825152.ps /home/pw/wessanet/rcomp/tmp/2q4g11502825152.png",intern=TRUE)) character(0) > > proc.time() user system elapsed 0.956 0.132 1.162