R version 2.12.1 (2010-12-16) 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(1686,1591,2304,1712,1471,1377,1966,2453,1984,2596,4087,5179,1530,1523,1633,1976,1170,1480,1781,2472,1981,2273,3857,4551,1510,1329,1518,1790,1537,1449,1954,1897,1706,2514,3593,4524,1609,1638,2030,1375,1320,1245,1600,2298,2191,2511,3440,4923,1609,1435,2061,1789,1567,1404,1597,3159,1759,2504,4273,5274,1771,1682,1846,1589,1896,1379,1645,2512,1771,3727,4388,5434,1606,1523,1577,1605,1765,1403,2584,3318,1562,2349,3987,5891,1389,1442,1548,1935,1518,1250,1847,1930,2638,3114,4405,7242,1853,1779,2108,2336,1728,1661,2230,1645,2421,3740,4988,6757,1757,1394,1982,1650,1654,1406,1971,1968,2608,3845,4514,6694,1720,1321,1859,1628,1615,1457,1899,1605,2424,3116,4286,6047,1902,2049,1874,1279,1432,1540,2214,1857,2408,3252,3627,6153,1577,1667,1993,1997,1783,1625,2076,1773,2377,3088,4096,6119,1494,1564,1898,2121,1831,1515,2048,2795,1749,3339,4227,6410,1197,1968,1720,1725,1674,1693,2031,1495,2968,3385,3729,5999,1070,1402,1897,1862,1670,1688,2031) > 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] 187 > (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] [,11] [,12] [,13] [1,] 1686 1530 1510 1609 1609 1771 1606 1389 1853 1757 1720 1902 1577 [2,] 1591 1523 1329 1638 1435 1682 1523 1442 1779 1394 1321 2049 1667 [3,] 2304 1633 1518 2030 2061 1846 1577 1548 2108 1982 1859 1874 1993 [4,] 1712 1976 1790 1375 1789 1589 1605 1935 2336 1650 1628 1279 1997 [5,] 1471 1170 1537 1320 1567 1896 1765 1518 1728 1654 1615 1432 1783 [6,] 1377 1480 1449 1245 1404 1379 1403 1250 1661 1406 1457 1540 1625 [7,] 1966 1781 1954 1600 1597 1645 2584 1847 2230 1971 1899 2214 2076 [8,] 2453 2472 1897 2298 3159 2512 3318 1930 1645 1968 1605 1857 1773 [9,] 1984 1981 1706 2191 1759 1771 1562 2638 2421 2608 2424 2408 2377 [10,] 2596 2273 2514 2511 2504 3727 2349 3114 3740 3845 3116 3252 3088 [11,] 4087 3857 3593 3440 4273 4388 3987 4405 4988 4514 4286 3627 4096 [12,] 5179 4551 4524 4923 5274 5434 5891 7242 6757 6694 6047 6153 6119 [,14] [,15] [1,] 1494 1197 [2,] 1564 1968 [3,] 1898 1720 [4,] 2121 1725 [5,] 1831 1674 [6,] 1515 1693 [7,] 2048 2031 [8,] 2795 1495 [9,] 1749 2968 [10,] 3339 3385 [11,] 4227 3729 [12,] 6410 5999 > 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] 2367.167 2185.583 2110.083 2181.667 2369.250 2470.000 2430.833 2521.500 [9] 2770.500 2620.250 2414.750 2465.583 2514.250 2582.583 2465.333 > arr.sd [1] 1148.7114 1019.4198 982.1543 1064.9702 1247.9182 1314.5998 1361.2100 [8] 1741.5622 1601.1596 1610.6048 1422.9301 1354.3023 1349.9733 1463.4953 [15] 1364.9721 > arr.range [1] 3802 3381 3195 3678 3870 4055 4488 5992 5112 5300 4726 4874 4542 4916 4802 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean -1369.303 1.113 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) -9.189 2.101 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean -4356.808 3.622 > postscript(file="/var/www/rcomp/tmp/1t98g1304518757.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/2hqt81304518757.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/32vjq1304518757.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/4jmob1304518757.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/5pz5y1304518757.tab") > > try(system("convert tmp/1t98g1304518757.ps tmp/1t98g1304518757.png",intern=TRUE)) character(0) > try(system("convert tmp/2hqt81304518757.ps tmp/2hqt81304518757.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.848 0.172 1.083