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(2938,2909,3141,2427,3059,2918,2901,2823,2798,2892,2967,2397,3458,3024,3100,2904,3056,2771,2897,2772,2857,3020,2648,2364,3194,3013,2560,3074,2746,2846,3184,2354,3080,2963,2430,2296,2416,2647,2789,2685,2666,2882,2953,2127,2563,3061,2809,2861,2781,2555,3206,2570,2410,3195,2736,2743,2934,2668,2907,2866,2983,2878,3225,2515,3193,2663,2908,2896,2853,3028,3053,2455,3401,2969,3243,2849,3296,3121,3194,3023,2984,3525,3116,2383,3294,2882,2820,2583,2803,2767,2945,2716,2644,2956,2598,2171,2994,2645,2724,2550,2707,2679,2878,2307,2496,2637,2436,2426,2607,2533,2888,2520,2229,2804,2661,2547,2509,2465,2629,2706,2666,2432,2836,2888,2566,2802,2611,2683,2675,2434,2693,2619,2903,2550,2900,2456,2912,2883,2464,2655,2447,2592,2698,2274,2901,2397,3004,2614,2882,2671,2761,2806,2414,2673,2748,2112,2903,2633,2684,2861,2504,2708,2961,2535,2688,2699,2469,2585,2582,2480,2709,2441,2182,2585,2881,2422,2690,2659,2535,2613) > 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] 180 > (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,] 2938 3458 3194 2416 2781 2983 3401 3294 2994 2607 2666 2903 2901 [2,] 2909 3024 3013 2647 2555 2878 2969 2882 2645 2533 2432 2550 2397 [3,] 3141 3100 2560 2789 3206 3225 3243 2820 2724 2888 2836 2900 3004 [4,] 2427 2904 3074 2685 2570 2515 2849 2583 2550 2520 2888 2456 2614 [5,] 3059 3056 2746 2666 2410 3193 3296 2803 2707 2229 2566 2912 2882 [6,] 2918 2771 2846 2882 3195 2663 3121 2767 2679 2804 2802 2883 2671 [7,] 2901 2897 3184 2953 2736 2908 3194 2945 2878 2661 2611 2464 2761 [8,] 2823 2772 2354 2127 2743 2896 3023 2716 2307 2547 2683 2655 2806 [9,] 2798 2857 3080 2563 2934 2853 2984 2644 2496 2509 2675 2447 2414 [10,] 2892 3020 2963 3061 2668 3028 3525 2956 2637 2465 2434 2592 2673 [11,] 2967 2648 2430 2809 2907 3053 3116 2598 2436 2629 2693 2698 2748 [12,] 2397 2364 2296 2861 2866 2455 2383 2171 2426 2706 2619 2274 2112 [,14] [,15] [1,] 2903 2582 [2,] 2633 2480 [3,] 2684 2709 [4,] 2861 2441 [5,] 2504 2182 [6,] 2708 2585 [7,] 2961 2881 [8,] 2535 2422 [9,] 2688 2690 [10,] 2699 2659 [11,] 2469 2535 [12,] 2585 2613 > 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] 2847.500 2905.917 2811.667 2704.917 2797.583 2887.500 3092.000 2764.917 [9] 2623.250 2591.500 2658.750 2644.500 2665.250 2685.833 2564.917 > arr.sd [1] 223.5582 268.1172 327.3776 253.1315 242.0944 241.4865 294.2621 269.3046 [9] 195.1294 169.8622 141.7303 217.3370 251.7261 156.6768 175.4695 > arr.range [1] 744 1094 898 934 796 770 1142 1123 687 659 456 638 892 492 699 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean -461.2372 0.2508 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) -19.812 3.185 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean -1846.149 0.963 > postscript(file="/var/www/html/rcomp/tmp/1ouxo1291550888.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/html/rcomp/tmp/2ouxo1291550888.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/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/39uwc1291550888.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/4dvvi1291550888.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/5gwt61291550888.tab") > > try(system("convert tmp/1ouxo1291550888.ps tmp/1ouxo1291550888.png",intern=TRUE)) character(0) > try(system("convert tmp/2ouxo1291550888.ps tmp/2ouxo1291550888.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.512 0.288 1.473