R version 2.13.0 (2011-04-13) Copyright (C) 2011 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(1220,1250,1350,1380,1310,1350,1360,1230,1330,1330,1380,1340,1220,1230,1400,1320,1320,1380,1340,1220,1310,1280,1330,1350,1240,1260,1340,1270,1330,1440,1350,1220,1310,1350,1300,1410,1260,1210,1410,1240,1360,1420,1310,1360,1260,1410,1330,1400,1240,1280,1460,1250,1340,1440,1170,1420,1250,1390,1260,1390,1290,1310,1540,1250,1320,1430,1080,1370,1290,1380,1260,1400,1250,1290,1550,1200,1320,1500,1060,1220,1260,1270,1280,1350,1320,1350,1530,1150,1270,1460,1000,1290,1330,1180,1350,1300,1350,1350,1540,1180,1280,1520,960,1420,1370,1210,1320,1260) > 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,] 1220 1310 1330 1220 1320 1310 1240 1330 1310 1260 1360 1260 1240 1340 [2,] 1250 1350 1330 1230 1380 1280 1260 1440 1350 1210 1420 1410 1280 1440 [3,] 1350 1360 1380 1400 1340 1330 1340 1350 1300 1410 1310 1330 1460 1170 [4,] 1380 1230 1340 1320 1220 1350 1270 1220 1410 1240 1360 1400 1250 1420 [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25] [,26] [1,] 1250 1290 1320 1290 1250 1320 1260 1320 1270 1330 1350 1280 [2,] 1390 1310 1430 1380 1290 1500 1270 1350 1460 1180 1350 1520 [3,] 1260 1540 1080 1260 1550 1060 1280 1530 1000 1350 1540 960 [4,] 1390 1250 1370 1400 1200 1220 1350 1150 1290 1300 1180 1420 [,27] [1,] 1370 [2,] 1210 [3,] 1320 [4,] 1260 > 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] 1300.0 1312.5 1345.0 1292.5 1315.0 1317.5 1277.5 1335.0 1342.5 1280.0 [11] 1362.5 1350.0 1307.5 1342.5 1322.5 1347.5 1300.0 1332.5 1322.5 1275.0 [21] 1290.0 1337.5 1255.0 1290.0 1355.0 1295.0 1290.0 > arr.sd [1] 77.02813 59.09033 23.80476 84.60693 68.06859 29.86079 43.49329 [8] 90.36961 49.91660 89.06926 45.00000 69.76150 103.07764 122.84814 [15] 78.04913 130.73510 153.40578 68.00735 156.07156 184.30048 40.82483 [22] 155.64382 190.17536 76.15773 147.08274 244.06283 69.76150 > arr.range [1] 160 130 50 180 160 70 100 220 110 200 110 150 220 270 140 290 350 140 350 [20] 440 90 380 460 170 360 560 160 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean 700.8430 -0.4585 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) 45.311 -5.693 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean 1665.039 -1.097 > postscript(file="/var/wessaorg/rcomp/tmp/1aym81312383413.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/27ymm1312383413.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/3le7f1312383413.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/4z24h1312383413.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/56ava1312383414.tab") > > try(system("convert tmp/1aym81312383413.ps tmp/1aym81312383413.png",intern=TRUE)) character(0) > try(system("convert tmp/27ymm1312383413.ps tmp/27ymm1312383413.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.629 0.111 0.737