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(1954,2302,3054,2414,2226,2725,2589,3470,2400,3180,4009,3924,2072,2434,2956,2828,2687,2629,3150,4119,3030,3055,3821,4001,2529,2472,3134,2789,2758,2993,3282,3437,2804,3076,3782,3889,2271,2452,3084,2522,2769,3438,2839,3746,2632,2851,3871,3618,2389,2344,2678,2492,2858,2246,2800,3869,3007,3023,3907,4209,2353,2570,2903,2910,3782,2759,2931,3641,2794,3070,3576,4106,2452,2206,2488,2416,2534,2521,3093,3903,2907,3025,3812,4209,2138,2419,2622,2912,2708,2798,3254,2895,3263,3736,4077,4097,2175,3138,2823,2498,2822,2738,4137,3515,3785,3632,4504,4451,2550,2867,3458,2961,3163,2880,3331,3062,3534,3622,4464,5411,2564,2820,3508,3088,3299,2939,3320,3418,3604,3495,4163,4882,2211,3260,2992,2425,2707,3244,3965,3315,3333,3583,4021,4904,2252,2952,3573,3048,3059,2731,3563,3092,3478,3478,4308,5029,2075,3264,3308,3688,3136,2824,3644,4694,2914,3686,4358,5587,2265,3685,3754,3708,3210,3517,3905,3670,4221,4404,5086,5725,2367,3819,4067,4022,3937,4365,4290) > 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,] 1954 2072 2529 2271 2389 2353 2452 2138 2175 2550 2564 2211 2252 [2,] 2302 2434 2472 2452 2344 2570 2206 2419 3138 2867 2820 3260 2952 [3,] 3054 2956 3134 3084 2678 2903 2488 2622 2823 3458 3508 2992 3573 [4,] 2414 2828 2789 2522 2492 2910 2416 2912 2498 2961 3088 2425 3048 [5,] 2226 2687 2758 2769 2858 3782 2534 2708 2822 3163 3299 2707 3059 [6,] 2725 2629 2993 3438 2246 2759 2521 2798 2738 2880 2939 3244 2731 [7,] 2589 3150 3282 2839 2800 2931 3093 3254 4137 3331 3320 3965 3563 [8,] 3470 4119 3437 3746 3869 3641 3903 2895 3515 3062 3418 3315 3092 [9,] 2400 3030 2804 2632 3007 2794 2907 3263 3785 3534 3604 3333 3478 [10,] 3180 3055 3076 2851 3023 3070 3025 3736 3632 3622 3495 3583 3478 [11,] 4009 3821 3782 3871 3907 3576 3812 4077 4504 4464 4163 4021 4308 [12,] 3924 4001 3889 3618 4209 4106 4209 4097 4451 5411 4882 4904 5029 [,14] [,15] [1,] 2075 2265 [2,] 3264 3685 [3,] 3308 3754 [4,] 3688 3708 [5,] 3136 3210 [6,] 2824 3517 [7,] 3644 3905 [8,] 4694 3670 [9,] 2914 4221 [10,] 3686 4404 [11,] 4358 5086 [12,] 5587 5725 > 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] 2853.917 3065.167 3078.750 3007.750 2985.167 3116.250 2963.833 3076.583 [9] 3351.500 3441.917 3425.000 3330.000 3380.250 3598.167 3929.167 > arr.sd [1] 674.2219 629.0207 453.6545 538.7187 662.7432 534.8274 668.7300 627.8871 [9] 771.1717 790.3176 617.5747 739.0584 728.8414 931.6875 880.9816 > arr.range [1] 2055 2047 1417 1600 1963 1753 2003 1959 2329 2861 2318 2693 2777 3512 3460 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean -366.2871 0.3239 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) -5.542 1.492 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean -3796.300 1.887 > postscript(file="/var/www/rcomp/tmp/1zzvw1324122233.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/2s5q61324122233.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/35o5m1324122233.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/4qdyy1324122233.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/5hb5z1324122233.tab") > > try(system("convert tmp/1zzvw1324122233.ps tmp/1zzvw1324122233.png",intern=TRUE)) character(0) > try(system("convert tmp/2s5q61324122233.ps tmp/2s5q61324122233.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.000 0.090 1.097