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(1375.06,1334.38,1335.61,1307.24,1183.2,1187.79,1270.81,1238.67,1204.45,1178.5,1044.64,1076.59,1129.68,1144.93,1140.21,1100.29,1153.79,1114.2,1079.27,1014.05,903.69,912.55,867.81,854.54,911.17,899.26,895.87,837.61,846.62,890.19,935.96,988,992.55,989.53,1019.44,1038.73,1049.9,1080.64,1132.52,1143.37,1123.98,1133.07,1102.78,1132.76,1105.85,1088.93,1117.66,1118.07,1168.94,1199.21,1181.4,1199.63,1194.9,1164.42,1178.28,1202.25,1222.24,1224.27,1225.91,1191.96,1237.37,1262.07,1278.72,1276.65,1293.83,1302.18,1290,1253.12,1260.24,1287.15,1317.81,1363.38,1388.63,1416.42,1424.16,1444.65,1406.95,1463.65,1511.14,1514.49,1520.98,1454.62,1497.12,1539.66,1463.39,1479.23,1378.76,1354.87,1316.94,1370.47,1403.22,1341.25,1257.33,1281.47,1216.93,969.13,883.04) > 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] 97 > (np <- floor(n / par1)) [1] 8 > 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] [1,] 1375.06 1129.68 911.17 1049.90 1168.94 1237.37 1388.63 1463.39 [2,] 1334.38 1144.93 899.26 1080.64 1199.21 1262.07 1416.42 1479.23 [3,] 1335.61 1140.21 895.87 1132.52 1181.40 1278.72 1424.16 1378.76 [4,] 1307.24 1100.29 837.61 1143.37 1199.63 1276.65 1444.65 1354.87 [5,] 1183.20 1153.79 846.62 1123.98 1194.90 1293.83 1406.95 1316.94 [6,] 1187.79 1114.20 890.19 1133.07 1164.42 1302.18 1463.65 1370.47 [7,] 1270.81 1079.27 935.96 1102.78 1178.28 1290.00 1511.14 1403.22 [8,] 1238.67 1014.05 988.00 1132.76 1202.25 1253.12 1514.49 1341.25 [9,] 1204.45 903.69 992.55 1105.85 1222.24 1260.24 1520.98 1257.33 [10,] 1178.50 912.55 989.53 1088.93 1224.27 1287.15 1454.62 1281.47 [11,] 1044.64 867.81 1019.44 1117.66 1225.91 1317.81 1497.12 1216.93 [12,] 1076.59 854.54 1038.73 1118.07 1191.96 1363.38 1539.66 969.13 > 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] 1228.0783 1034.5842 937.0775 1110.7942 1196.1175 1285.2100 1465.2058 [8] 1319.4158 > arr.sd [1] 102.65712 117.51821 67.15912 26.91728 20.71220 33.24166 50.51644 [8] 134.72478 > arr.range [1] 330.42 299.25 201.12 93.47 61.49 126.01 151.03 510.10 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean 85.89530 -0.01396 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) 6.6951 -0.3762 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean 129.03541 0.07734 > postscript(file="/var/www/html/rcomp/tmp/1pitz1229012755.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/2bovj1229012755.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/390731229012755.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/4e4vi1229012755.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/5hk6o1229012755.tab") > > system("convert tmp/1pitz1229012755.ps tmp/1pitz1229012755.png") > system("convert tmp/2bovj1229012755.ps tmp/2bovj1229012755.png") > > > proc.time() user system elapsed 0.509 0.291 0.617