R version 2.9.0 (2009-04-17) Copyright (C) 2009 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(1920,2218,3032,2375,2446,2916,2434,2540,2349,2310,2189,2660,2194,2419,2742,2137,2710,2173,2363,2126,1905,2121,1983,1734,2074,2049,2406,2558,2251,2059,2397,1747,1707,2319,1631,1627,1791,2034,1997,2169,2028,2253,2218,1855,2187,1852,1570,1851,1954,1828,2251,2277,2085,2282,2266,1878,2267,2069,1746,2299,2360,2214,2825,2355,2333,3016,2155,2172,2150,2533,2058,2160,2260,2498,2695,2799,2947,2930,2318,2540,2570,2669,2450,2842,3440,2678,2981,2260,2844,2546,2456,2295,2379,2479,2057,2280,2351,2276,2548,2311,2201,2725,2408,2139,1898,2537,2069,2063,2526,2440,2191,2797,2074,2628,2287,2146,2430,2141,1827,2082,1788) > 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] 121 > (np <- floor(n / par1)) [1] 10 > 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,] 1920 2194 2074 1791 1954 2360 2260 3440 2351 2526 [2,] 2218 2419 2049 2034 1828 2214 2498 2678 2276 2440 [3,] 3032 2742 2406 1997 2251 2825 2695 2981 2548 2191 [4,] 2375 2137 2558 2169 2277 2355 2799 2260 2311 2797 [5,] 2446 2710 2251 2028 2085 2333 2947 2844 2201 2074 [6,] 2916 2173 2059 2253 2282 3016 2930 2546 2725 2628 [7,] 2434 2363 2397 2218 2266 2155 2318 2456 2408 2287 [8,] 2540 2126 1747 1855 1878 2172 2540 2295 2139 2146 [9,] 2349 1905 1707 2187 2267 2150 2570 2379 1898 2430 [10,] 2310 2121 2319 1852 2069 2533 2669 2479 2537 2141 [11,] 2189 1983 1631 1570 1746 2058 2450 2057 2069 1827 [12,] 2660 1734 1627 1851 2299 2160 2842 2280 2063 2082 > 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] 2449.083 2217.250 2068.750 1983.750 2100.167 2360.917 2626.500 2557.917 [9] 2293.833 2297.417 > arr.sd [1] 308.4585 300.3852 327.2972 206.1672 203.0194 294.0660 226.7079 379.9685 [9] 237.3451 273.9384 > arr.range [1] 1112 1008 931 683 553 958 687 1383 827 970 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean 47.5417 0.0994 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) -1.0863 0.8644 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean -312.5350 0.5331 > postscript(file="/var/www/html/rcomp/tmp/1pofu1261334212.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/2szgb1261334212.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/366wo1261334212.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/4mi5n1261334212.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/5fq251261334212.tab") > try(system("convert tmp/1pofu1261334212.ps tmp/1pofu1261334212.png",intern=TRUE)) character(0) > try(system("convert tmp/2szgb1261334212.ps tmp/2szgb1261334212.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.499 0.284 0.596