R version 3.2.5 (2016-04-14) -- "Very, Very Secure Dishes" Copyright (C) 2016 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. > x <- c(250785 + ,250140 + ,255755 + ,254671 + ,253919 + ,253741 + ,252729 + ,253810 + ,256653 + ,255231 + ,258405 + ,251061 + ,254811 + ,254895 + ,258325 + ,257608 + ,258759 + ,258621 + ,257852 + ,260560 + ,262358 + ,260812 + ,261165 + ,257164 + ,260720 + ,259581 + ,264743 + ,261845 + ,262262 + ,261631 + ,258953 + ,259966 + ,262850 + ,262204 + ,263418 + ,262752 + ,266433 + ,267722 + ,266003 + ,262971 + ,265521 + ,264676 + ,270223 + ,269508 + ,268457 + ,265814 + ,266680 + ,263018 + ,269285 + ,269829 + ,270911 + ,266844 + ,271244 + ,269907 + ,271296 + ,270157 + ,271322 + ,267179 + ,264101 + ,265518 + ,269419 + ,268714 + ,272482 + ,268351 + ,268175 + ,270674 + ,272764 + ,272599 + ,270333 + ,270846 + ,270491 + ,269160 + ,274027 + ,273784 + ,276663 + ,274525 + ,271344 + ,271115 + ,270798 + ,273911 + ,273985 + ,271917 + ,273338 + ,270601 + ,273547 + ,275363 + ,281229 + ,277793 + ,279913 + ,282500 + ,280041 + ,282166 + ,290304 + ,283519 + ,287816 + ,285226 + ,287595 + ,289741 + ,289148 + ,288301 + ,290155 + ,289648 + ,288225 + ,289351 + ,294735 + ,305333 + ,309030 + ,310215 + ,321935 + ,325734 + ,320846 + ,323023 + ,319753 + ,321753 + ,320757 + ,324479 + ,324641 + ,322767 + ,324181 + ,321389 + ,327897 + ,334287 + ,332653 + ,334819 + ,335264 + ,339622 + ,342440 + ,346585 + ,335378 + ,337010 + ,339130 + ,341193 + ,343507 + ,348915 + ,346431 + ,348322 + ,348288 + ,346597 + ,351076 + ,355215 + ,350562 + ,355266 + ,361565 + ,363462 + ,366183 + ,365423 + ,369208 + ,366713 + ,369354 + ,371970 + ,371824 + ,373187 + ,367270 + ,368140 + ,373742 + ,364815 + ,368558 + ,371503 + ,372611 + ,370197 + ,375441 + ,375888 + ,375132 + ,381142 + ,372024 + ,376070 + ,376864 + ,371401 + ,375687 + ,384304 + ,380738 + ,379908 + ,384007 + ,384499 + ,385106 + ,387935 + ,380435 + ,379281 + ,384153 + ,380599) > par1 = '12' > par1 <- '12' > #'GNU S' R Code compiled by R2WASP v. 1.2.291 () > #Author: root > #To cite this work: Wessa P. (2012), Standard Deviation-Mean Plot (v1.0.6) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_smp.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > # > par1 <- as.numeric(par1) > (n <- length(x)) [1] 180 > (np <- floor(n / par1)) [1] 15 > 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,] 250785 254811 260720 266433 269285 269419 274027 273547 287595 321935 [2,] 250140 254895 259581 267722 269829 268714 273784 275363 289741 325734 [3,] 255755 258325 264743 266003 270911 272482 276663 281229 289148 320846 [4,] 254671 257608 261845 262971 266844 268351 274525 277793 288301 323023 [5,] 253919 258759 262262 265521 271244 268175 271344 279913 290155 319753 [6,] 253741 258621 261631 264676 269907 270674 271115 282500 289648 321753 [7,] 252729 257852 258953 270223 271296 272764 270798 280041 288225 320757 [8,] 253810 260560 259966 269508 270157 272599 273911 282166 289351 324479 [9,] 256653 262358 262850 268457 271322 270333 273985 290304 294735 324641 [10,] 255231 260812 262204 265814 267179 270846 271917 283519 305333 322767 [11,] 258405 261165 263418 266680 264101 270491 273338 287816 309030 324181 [12,] 251061 257164 262752 263018 265518 269160 270601 285226 310215 321389 [,11] [,12] [,13] [,14] [,15] [1,] 327897 343507 366183 368558 375687 [2,] 334287 348915 365423 371503 384304 [3,] 332653 346431 369208 372611 380738 [4,] 334819 348322 366713 370197 379908 [5,] 335264 348288 369354 375441 384007 [6,] 339622 346597 371970 375888 384499 [7,] 342440 351076 371824 375132 385106 [8,] 346585 355215 373187 381142 387935 [9,] 335378 350562 367270 372024 380435 [10,] 337010 355266 368140 376070 379281 [11,] 339130 361565 373742 376864 384153 [12,] 341193 363462 364815 371401 380599 > 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] 253908.3 258577.5 261743.8 266418.8 268966.1 270334.0 273000.7 281618.1 [9] 294289.8 322604.8 337189.8 351600.5 368985.8 373902.6 382221.0 > arr.sd [1] 2467.718 2359.137 1684.598 2291.703 2456.080 1637.206 1843.895 4824.308 [9] 8637.488 1844.626 4950.200 6135.123 3077.589 3479.890 3332.080 > arr.range [1] 8265 7547 5790 7252 7221 4589 6062 16757 22620 5981 18688 19955 [13] 8927 12584 12248 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean -554.227 0.013 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) -10.551 1.471 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean -4.699e+03 5.147e-02 > postscript(file="/var/wessaorg/rcomp/tmp/1hevu1461518641.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/wessaorg/rcomp/tmp/2loai1461518641.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/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/wessaorg/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/wessaorg/rcomp/tmp/31bvc1461518641.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/wessaorg/rcomp/tmp/4rycp1461518641.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/wessaorg/rcomp/tmp/5f7k71461518641.tab") > > try(system("convert tmp/1hevu1461518641.ps tmp/1hevu1461518641.png",intern=TRUE)) character(0) > try(system("convert tmp/2loai1461518641.ps tmp/2loai1461518641.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.095 0.186 1.282