R version 2.12.0 (2010-10-15) Copyright (C) 2010 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-pc-linux-gnu (32-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(960,1160,1040,1030,1080,1020,1000,1060,1000,980,980,1080,980,1290,1030,1000,1130,1030,900,1040,1080,1010,890,1080,950,1310,1060,1070,1150,1060,950,1090,1080,1040,900,1000,1020,1250,1060,1050,1180,1100,1020,1090,1020,960,860,1070,1040,1310,1040,1010,1130,1030,930,1070,990,970,850,1130,1060,1380,1000,970,1080,940,960,1070,1010,1020,750,1140,1040,1420,900,900,1090,950,930,1080,1000,1010,770,1100,1100,1390,930,940,1100,1030,920,1080,1000,1070,830,1100,1170,1330,980,910,1030,970,960,1100,960,1080,730,1140) > 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] 108 > (np <- floor(n / par1)) [1] 27 > 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] [,11] [,12] [,13] [,14] [1,] 960 1080 1000 980 1130 1080 950 1150 1080 1020 1180 1020 1040 1130 [2,] 1160 1020 980 1290 1030 1010 1310 1060 1040 1250 1100 960 1310 1030 [3,] 1040 1000 980 1030 900 890 1060 950 900 1060 1020 860 1040 930 [4,] 1030 1060 1080 1000 1040 1080 1070 1090 1000 1050 1090 1070 1010 1070 [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25] [,26] [1,] 990 1060 1080 1010 1040 1090 1000 1100 1100 1000 1170 1030 [2,] 970 1380 940 1020 1420 950 1010 1390 1030 1070 1330 970 [3,] 850 1000 960 750 900 930 770 930 920 830 980 960 [4,] 1130 970 1070 1140 900 1080 1100 940 1080 1100 910 1100 [,27] [1,] 960 [2,] 1080 [3,] 730 [4,] 1140 > 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] 1047.5 1040.0 1010.0 1075.0 1025.0 1015.0 1097.5 1062.5 1005.0 1095.0 [11] 1097.5 977.5 1100.0 1040.0 985.0 1102.5 1012.5 980.0 1065.0 1012.5 [21] 970.0 1090.0 1032.5 1000.0 1097.5 1015.0 977.5 > arr.sd [1] 83.01606 36.51484 47.60952 144.79871 94.69248 89.62886 151.73991 [8] 83.81527 77.24420 104.72185 65.51081 90.32349 140.71247 84.06347 [15] 114.74610 188.74586 72.74384 164.31677 245.69629 84.21203 140.71247 [22] 214.63147 80.57088 120.83046 189.97807 64.54972 181.17671 > arr.range [1] 200 80 100 310 230 190 360 200 180 230 160 210 300 200 280 410 140 390 520 [20] 160 330 460 180 270 420 140 410 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean -243.8934 0.3476 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) -13.151 2.565 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean -442.8492 0.6785 > postscript(file="/var/www/rcomp/tmp/109ft1312566450.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/www/rcomp/tmp/28h4x1312566450.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/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/rcomp/tmp/374gk1312566450.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/rcomp/tmp/4ogr21312566450.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/rcomp/tmp/558da1312566450.tab") > > try(system("convert tmp/109ft1312566450.ps tmp/109ft1312566450.png",intern=TRUE)) character(0) > try(system("convert tmp/28h4x1312566450.ps tmp/28h4x1312566450.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.550 0.040 0.584