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(8.6658 + ,8.756 + ,8.8178 + ,8.8595 + ,8.8762 + ,8.968 + ,9.0638 + ,9.0789 + ,9.0529 + ,8.9548 + ,9.0355 + ,9.053 + ,9.1 + ,9.0772 + ,9.1346 + ,9.2651 + ,9.2939 + ,9.3752 + ,9.4915 + ,9.3559 + ,9.3608 + ,9.3325 + ,9.2437 + ,9.2667 + ,9.2212 + ,9.2691 + ,9.342 + ,9.2787 + ,9.3212 + ,9.2202 + ,9.2089 + ,9.2326 + ,9.3568 + ,9.3783 + ,9.3018 + ,9.2313 + ,9.2922 + ,9.2548 + ,9.3298 + ,9.2713 + ,9.2205 + ,9.1703 + ,9.1843 + ,9.1321 + ,9.1014 + ,9.0055 + ,9.0192 + ,8.9966 + ,8.9369 + ,8.9644 + ,8.8008 + ,8.7783 + ,8.7809 + ,8.7947 + ,8.7574 + ,8.669 + ,8.6558 + ,8.6138 + ,8.6248 + ,8.6267 + ,8.655 + ,8.7381 + ,8.732 + ,8.727 + ,8.7187 + ,8.6318 + ,8.6398 + ,8.6426 + ,8.631 + ,8.5751 + ,8.5719 + ,8.6391 + ,8.631 + ,8.7159 + ,8.7477 + ,8.7346 + ,8.7281 + ,8.6978 + ,8.6781 + ,8.8183 + ,8.8937 + ,8.9684 + ,8.9179 + ,8.9281 + ,8.9434 + ,8.9546 + ,8.8559 + ,8.8265 + ,8.8557 + ,8.806 + ,8.8345 + ,8.7666 + ,8.7446 + ,8.7123 + ,8.686 + ,8.7058 + ,8.7823 + ,8.8075 + ,8.6955 + ,8.6056 + ,8.5117 + ,8.5126 + ,8.5597 + ,8.5785 + ,8.5169 + ,8.5287 + ,8.4908 + ,8.4964 + ,8.3596 + ,8.3215 + ,8.2918 + ,8.3864 + ,8.3476 + ,8.3378 + ,8.3595 + ,8.3521 + ,8.4229 + ,8.4454 + ,8.4428 + ,8.388 + ,8.376 + ,8.3689 + ,8.2855 + ,8.2277 + ,8.2005 + ,8.1558 + ,8.1706 + ,8.2355 + ,8.3768 + ,8.3448 + ,8.3021 + ,8.4031 + ,8.4599 + ,8.372 + ,8.4059 + ,8.3495 + ,8.44 + ,8.5326 + ,8.4215 + ,8.3772 + ,8.4851 + ,8.4315 + ,8.528 + ,8.5943 + ,8.6611 + ,8.6715 + ,8.8533 + ,8.7 + ,8.6882 + ,8.8223 + ,8.9352 + ,9.0352 + ,9.0878 + ,9.0484 + ,9.0401 + ,9.0715 + ,9.0937 + ,9.0881 + ,9.1056 + ,9.1304 + ,9.2047 + ,9.1698 + ,9.2383 + ,9.2451 + ,9.2932 + ,9.2712 + ,9.2727 + ,9.1331 + ,9.0739 + ,9.1054 + ,9.1438 + ,9.1937 + ,9.2006 + ,9.2025 + ,9.1958 + ,9.1161 + ,9.1183 + ,9.1054 + ,9.2285 + ,9.1961 + ,9.2486 + ,9.3245 + ,9.3898 + ,9.3672 + ,9.355 + ,9.3953 + ,9.3231 + ,9.29 + ,9.2544 + ,9.3269 + ,9.2718 + ,9.3303 + ,9.3111 + ,9.2485 + ,9.2326 + ,9.2629 + ,9.2087 + ,9.2485 + ,9.2686 + ,9.3017 + ,9.2375 + ,9.2703 + ,9.379 + ,9.3264 + ,9.2977 + ,9.2737 + ,9.3757 + ,9.3847 + ,9.3935 + ,9.3355 + ,9.347 + ,9.4532 + ,9.5463 + ,9.5147 + ,9.499 + ,9.5343 + ,9.557 + ,9.6067 + ,9.6157 + ,9.6607 + ,9.6498 + ,9.6012 + ,9.6481 + ,9.7488 + ,9.8097 + ,9.813 + ,9.89 + ,9.9419 + ,9.8863 + ,9.9174 + ,9.7449 + ,9.7663 + ,9.7973 + ,9.8598 + ,9.8238 + ,9.835 + ,9.7861 + ,9.8569 + ,9.8386 + ,9.831 + ,9.7482 + ,9.7498 + ,9.8105 + ,9.7893 + ,9.7943 + ,9.9416 + ,9.9286 + ,10.0013 + ,10.0755 + ,10.0556 + ,10.083 + ,10.0869 + ,10.0982 + ,10.2869 + ,10.3224 + ,10.3009 + ,10.2895 + ,10.2564 + ,10.1866 + ,10.2882 + ,10.2975 + ,10.2229 + ,10.2233 + ,10.1154 + ,10.1491 + ,10.2111 + ,10.1544 + ,10.2166 + ,10.1493 + ,10.1867 + ,10.2641 + ,10.217 + ,10.2292 + ,10.1467 + ,10.1506 + ,10.0773 + ,10.0085 + ,10.0862 + ,10.1047 + ,10.0972 + ,10.0955 + ,10.1583 + ,10.2547 + ,10.2564 + ,10.2438 + ,10.187 + ,10.22 + ,10.1841 + ,10.1508 + ,10.1502 + ,10.1585 + ,10.1469 + ,10.0748 + ,10.0678 + ,10.0777 + ,10.0306 + ,10.0497 + ,9.9773 + ,9.9234 + ,9.9248 + ,9.9958 + ,9.9341 + ,10.0023 + ,10.017 + ,10.0824 + ,10.091 + ,10.0902 + ,10.0098 + ,10.0404 + ,10.0431 + ,10.0141 + ,9.9777 + ,9.9436 + ,9.9662 + ,9.9334 + ,9.9168 + ,9.8814 + ,9.786 + ,9.7409 + ,9.7915 + ,9.7137 + ,9.777 + ,9.7486 + ,9.8108 + ,9.7479 + ,9.748 + ,9.7859 + ,9.7845 + ,9.7891 + ,9.7305 + ,9.6443 + ,9.6365 + ,9.6203 + ,9.7688 + ,9.7674 + ,9.6853 + ,9.6825 + ,9.7062 + ,9.8084 + ,9.8164 + ,9.8433 + ,9.8246 + ,9.7701 + ,9.6592 + ,9.6014 + ,9.635 + ,9.7197 + ,9.7472 + ,9.7185 + ,9.7198 + ,9.6933 + ,9.7153 + ,9.7118 + ,9.6259 + ,9.6526 + ,9.625 + ,9.5599 + ,9.5487 + ,9.4983 + ,9.5575 + ,9.4984 + ,9.5788 + ,9.4979 + ,9.5714 + ,9.5974 + ,9.6319 + ,9.6545 + ,9.607 + ,9.6329 + ,9.5276 + ,9.5857 + ,9.5537 + ,9.4728 + ,9.5242 + ,9.5139 + ,9.463 + ,9.4926 + ,9.4684 + ,9.5701 + ,9.5475 + ,9.6365 + ,9.5415 + ,9.4803 + ,9.6871 + ,9.6313 + ,9.7044 + ,9.7261 + ,9.7073 + ,9.6263 + ,9.461 + ,9.4917 + ,9.5 + ,9.5601 + ,9.5334 + ,9.3983 + ,9.3434 + ,9.2896 + ,9.2124 + ,9.2271 + ,9.2567 + ,9.2942 + ,9.334 + ,9.2615 + ,9.1583 + ,9.116 + ,9.0877 + ,9.1407 + ,9.0221 + ,9.0575 + ,9.0547 + ,8.8692 + ,8.961 + ,9.0339 + ,8.913 + ,8.8428 + ,8.8354 + ,8.8604 + ,8.922 + ,9.0163 + ,9.0001 + ,9.0702 + ,9.0717 + ,9.0446 + ,9.0622 + ,9.2242 + ,9.1757 + ,9.1533 + ,9.0527 + ,9.0942 + ,9.0893 + ,9.0838 + ,9.2191 + ,9.2176 + ,9.2247 + ,9.2623 + ,9.2509 + ,9.3352 + ,8.974 + ,8.8487 + ,8.9183 + ,8.8244 + ,8.7414 + ,8.7461 + ,8.7451 + ,8.5945 + ,8.6581 + ,8.5885 + ,8.5915 + ,8.6303 + ,8.623 + ,8.6482 + ,8.7429 + ,8.7485 + ,8.7264 + ,8.7487 + ,8.6087 + ,8.6844 + ,8.6131 + ,8.641 + ,8.7236 + ,8.7626 + ,8.7703 + ,8.8409 + ,8.8598 + ,8.8894 + ,8.7453 + ,8.7708 + ,8.7598 + ,8.7891 + ,8.7389 + ,8.7636 + ,8.9653 + ,9.0672 + ,9.0084 + ,8.8826 + ,8.7492 + ,8.8773 + ,8.8276 + ,8.8422 + ,9.0111 + ,9.0732 + ,8.9453 + ,9.004 + ,9.0634 + ,9.1575 + ,9.3538 + ,9.3068 + ,9.2908 + ,9.1138 + ,9.2781 + ,9.4608) > ylimmax = '' > ylimmin = '' > main = 'Robustness of Central Tendency' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: Wessa, P., (2007), Central Tendency (v1.0.2) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_centraltendency.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > #Technical description: Write here your technical program description (don't use hard returns!) > geomean <- function(x) { + return(exp(mean(log(x)))) + } > harmean <- function(x) { + return(1/mean(1/x)) + } > quamean <- function(x) { + return(sqrt(mean(x*x))) + } > winmean <- function(x) { + x <-sort(x[!is.na(x)]) + n<-length(x) + denom <- 3 + nodenom <- n/denom + if (nodenom>40) denom <- n/40 + sqrtn = sqrt(n) + roundnodenom = floor(nodenom) + win <- array(NA,dim=c(roundnodenom,2)) + for (j in 1:roundnodenom) { + win[j,1] <- (j*x[j+1]+sum(x[(j+1):(n-j)])+j*x[n-j])/n + win[j,2] <- sd(c(rep(x[j+1],j),x[(j+1):(n-j)],rep(x[n-j],j)))/sqrtn + } + return(win) + } > trimean <- function(x) { + x <-sort(x[!is.na(x)]) + n<-length(x) + denom <- 3 + nodenom <- n/denom + if (nodenom>40) denom <- n/40 + sqrtn = sqrt(n) + roundnodenom = floor(nodenom) + tri <- array(NA,dim=c(roundnodenom,2)) + for (j in 1:roundnodenom) { + tri[j,1] <- mean(x,trim=j/n) + tri[j,2] <- sd(x[(j+1):(n-j)]) / sqrt(n-j*2) + } + return(tri) + } > midrange <- function(x) { + return((max(x)+min(x))/2) + } > q1 <- function(data,n,p,i,f) { + np <- n*p; + i <<- floor(np) + f <<- np - i + qvalue <- (1-f)*data[i] + f*data[i+1] + } > q2 <- function(data,n,p,i,f) { + np <- (n+1)*p + i <<- floor(np) + f <<- np - i + qvalue <- (1-f)*data[i] + f*data[i+1] + } > q3 <- function(data,n,p,i,f) { + np <- n*p + i <<- floor(np) + f <<- np - i + if (f==0) { + qvalue <- data[i] + } else { + qvalue <- data[i+1] + } + } > q4 <- function(data,n,p,i,f) { + np <- n*p + i <<- floor(np) + f <<- np - i + if (f==0) { + qvalue <- (data[i]+data[i+1])/2 + } else { + qvalue <- data[i+1] + } + } > q5 <- function(data,n,p,i,f) { + np <- (n-1)*p + i <<- floor(np) + f <<- np - i + if (f==0) { + qvalue <- data[i+1] + } else { + qvalue <- data[i+1] + f*(data[i+2]-data[i+1]) + } + } > q6 <- function(data,n,p,i,f) { + np <- n*p+0.5 + i <<- floor(np) + f <<- np - i + qvalue <- data[i] + } > q7 <- function(data,n,p,i,f) { + np <- (n+1)*p + i <<- floor(np) + f <<- np - i + if (f==0) { + qvalue <- data[i] + } else { + qvalue <- f*data[i] + (1-f)*data[i+1] + } + } > q8 <- function(data,n,p,i,f) { + np <- (n+1)*p + i <<- floor(np) + f <<- np - i + if (f==0) { + qvalue <- data[i] + } else { + if (f == 0.5) { + qvalue <- (data[i]+data[i+1])/2 + } else { + if (f < 0.5) { + qvalue <- data[i] + } else { + qvalue <- data[i+1] + } + } + } + } > midmean <- function(x,def) { + x <-sort(x[!is.na(x)]) + n<-length(x) + if (def==1) { + qvalue1 <- q1(x,n,0.25,i,f) + qvalue3 <- q1(x,n,0.75,i,f) + } + if (def==2) { + qvalue1 <- q2(x,n,0.25,i,f) + qvalue3 <- q2(x,n,0.75,i,f) + } + if (def==3) { + qvalue1 <- q3(x,n,0.25,i,f) + qvalue3 <- q3(x,n,0.75,i,f) + } + if (def==4) { + qvalue1 <- q4(x,n,0.25,i,f) + qvalue3 <- q4(x,n,0.75,i,f) + } + if (def==5) { + qvalue1 <- q5(x,n,0.25,i,f) + qvalue3 <- q5(x,n,0.75,i,f) + } + if (def==6) { + qvalue1 <- q6(x,n,0.25,i,f) + qvalue3 <- q6(x,n,0.75,i,f) + } + if (def==7) { + qvalue1 <- q7(x,n,0.25,i,f) + qvalue3 <- q7(x,n,0.75,i,f) + } + if (def==8) { + qvalue1 <- q8(x,n,0.25,i,f) + qvalue3 <- q8(x,n,0.75,i,f) + } + midm <- 0 + myn <- 0 + roundno4 <- round(n/4) + round3no4 <- round(3*n/4) + for (i in 1:n) { + if ((x[i]>=qvalue1) & (x[i]<=qvalue3)){ + midm = midm + x[i] + myn = myn + 1 + } + } + midm = midm / myn + return(midm) + } > (arm <- mean(x)) [1] 9.269986 > sqrtn <- sqrt(length(x)) > (armse <- sd(x) / sqrtn) [1] 0.02393877 > (armose <- arm / armse) [1] 387.2373 > (geo <- geomean(x)) [1] 9.254852 > (har <- harmean(x)) [1] 9.23974 > (qua <- quamean(x)) [1] 9.28512 > (win <- winmean(x)) [,1] [,2] [1,] 9.269973 0.02393204 [2,] 9.270080 0.02391956 [3,] 9.270198 0.02390031 [4,] 9.270251 0.02389375 [5,] 9.270747 0.02384864 [6,] 9.270545 0.02381819 [7,] 9.270582 0.02379662 [8,] 9.270898 0.02377061 [9,] 9.271166 0.02374381 [10,] 9.271086 0.02371374 [11,] 9.270822 0.02368154 [12,] 9.270724 0.02366598 [13,] 9.270782 0.02365964 [14,] 9.270911 0.02363620 [15,] 9.270822 0.02362846 [16,] 9.271112 0.02360365 [17,] 9.271029 0.02357975 [18,] 9.270292 0.02349724 [19,] 9.270312 0.02349391 [20,] 9.270324 0.02349232 [21,] 9.270610 0.02345341 [22,] 9.269535 0.02335776 [23,] 9.270233 0.02330293 [24,] 9.270179 0.02327775 [25,] 9.270790 0.02320379 [26,] 9.270854 0.02319744 [27,] 9.271305 0.02316060 [28,] 9.271738 0.02312089 [29,] 9.271892 0.02310785 [30,] 9.271916 0.02308583 [31,] 9.272819 0.02301841 [32,] 9.272421 0.02274503 [33,] 9.272085 0.02266386 [34,] 9.272023 0.02260298 [35,] 9.273042 0.02252185 [36,] 9.272984 0.02250800 [37,] 9.272969 0.02246045 [38,] 9.273766 0.02239715 [39,] 9.273559 0.02237390 [40,] 9.273820 0.02234812 [41,] 9.275816 0.02217713 [42,] 9.276808 0.02210497 [43,] 9.276677 0.02205620 [44,] 9.276945 0.02203379 [45,] 9.277697 0.02196257 [46,] 9.277912 0.02193974 [47,] 9.277510 0.02187310 [48,] 9.276337 0.02178435 [49,] 9.276856 0.02167104 [50,] 9.276500 0.02160230 [51,] 9.276676 0.02155323 [52,] 9.275713 0.02147382 [53,] 9.275238 0.02130675 [54,] 9.275117 0.02127175 [55,] 9.274848 0.02122439 [56,] 9.275110 0.02118836 [57,] 9.274472 0.02113260 [58,] 9.274354 0.02112430 [59,] 9.273789 0.02107201 [60,] 9.272469 0.02086301 [61,] 9.272506 0.02085420 [62,] 9.271256 0.02074857 [63,] 9.268562 0.02053946 [64,] 9.269070 0.02047932 [65,] 9.269931 0.02042114 [66,] 9.269030 0.02034707 [67,] 9.269248 0.02032142 [68,] 9.268999 0.02025168 [69,] 9.269125 0.02017584 [70,] 9.269382 0.02013480 [71,] 9.268876 0.02005543 [72,] 9.269756 0.01999097 [73,] 9.266708 0.01967397 [74,] 9.266391 0.01962340 [75,] 9.265979 0.01955497 [76,] 9.263766 0.01927402 [77,] 9.263671 0.01922367 [78,] 9.261860 0.01906740 [79,] 9.262037 0.01896442 [80,] 9.262510 0.01886484 [81,] 9.262444 0.01878873 [82,] 9.261843 0.01869515 [83,] 9.262536 0.01863784 [84,] 9.261749 0.01853202 [85,] 9.261264 0.01849000 [86,] 9.261071 0.01845520 [87,] 9.261709 0.01841131 [88,] 9.262032 0.01837526 [89,] 9.262431 0.01832383 [90,] 9.260543 0.01819214 [91,] 9.260450 0.01813160 [92,] 9.260207 0.01808369 [93,] 9.260112 0.01803994 [94,] 9.260169 0.01803207 [95,] 9.259627 0.01799511 [96,] 9.259764 0.01798482 [97,] 9.260061 0.01796523 [98,] 9.259941 0.01793926 [99,] 9.258469 0.01784695 [100,] 9.257166 0.01775793 [101,] 9.258297 0.01766073 [102,] 9.258297 0.01762671 [103,] 9.258570 0.01758394 [104,] 9.255668 0.01734499 [105,] 9.255668 0.01732016 [106,] 9.256272 0.01728015 [107,] 9.256991 0.01722852 [108,] 9.257057 0.01721962 [109,] 9.258700 0.01712268 [110,] 9.259126 0.01708022 [111,] 9.258922 0.01703184 [112,] 9.259561 0.01689036 [113,] 9.258456 0.01667843 [114,] 9.258851 0.01653927 [115,] 9.258593 0.01638561 [116,] 9.258924 0.01636429 [117,] 9.261093 0.01621026 [118,] 9.260444 0.01615932 [119,] 9.261025 0.01608299 [120,] 9.261074 0.01602777 [121,] 9.260483 0.01593545 [122,] 9.260483 0.01590463 [123,] 9.261760 0.01578308 [124,] 9.259185 0.01561073 [125,] 9.259006 0.01544383 [126,] 9.258878 0.01539928 [127,] 9.258309 0.01534982 [128,] 9.254164 0.01494675 [129,] 9.254978 0.01485807 [130,] 9.254369 0.01475404 [131,] 9.253916 0.01472306 [132,] 9.254131 0.01462815 [133,] 9.253752 0.01459827 [134,] 9.252878 0.01453216 [135,] 9.253153 0.01428141 [136,] 9.255092 0.01417534 [137,] 9.254981 0.01413563 [138,] 9.255880 0.01402217 [139,] 9.257522 0.01390231 [140,] 9.258577 0.01382676 [141,] 9.262684 0.01345137 [142,] 9.263985 0.01336996 [143,] 9.263839 0.01334933 [144,] 9.263546 0.01321603 [145,] 9.263989 0.01304641 [146,] 9.263513 0.01279362 [147,] 9.263932 0.01276206 [148,] 9.264294 0.01257231 [149,] 9.264810 0.01253898 [150,] 9.266490 0.01232818 [151,] 9.262954 0.01212873 [152,] 9.262737 0.01191354 [153,] 9.261490 0.01173422 [154,] 9.261365 0.01169767 [155,] 9.259060 0.01148415 [156,] 9.259124 0.01147418 [157,] 9.260147 0.01134072 [158,] 9.267259 0.01096153 [159,] 9.267324 0.01084686 [160,] 9.266965 0.01069534 [161,] 9.267064 0.01064952 [162,] 9.267624 0.01058034 [163,] 9.266927 0.01044999 > (tri <- trimean(x)) [,1] [,2] [1,] 9.269986 0.02383114 [2,] 9.270112 0.02372773 [3,] 9.270341 0.02362822 [4,] 9.270341 0.02353294 [5,] 9.270425 0.02343701 [6,] 9.270359 0.02334835 [7,] 9.270328 0.02326294 [8,] 9.270328 0.02317874 [9,] 9.270211 0.02309597 [10,] 9.270101 0.02301441 [11,] 9.269997 0.02293413 [12,] 9.269919 0.02285512 [13,] 9.269848 0.02277554 [14,] 9.269771 0.02269444 [15,] 9.269685 0.02261318 [16,] 9.269685 0.02253037 [17,] 9.269502 0.02244725 [18,] 9.269405 0.02236363 [19,] 9.269352 0.02228346 [20,] 9.269297 0.02220133 [21,] 9.269241 0.02211709 [22,] 9.269169 0.02203292 [23,] 9.269151 0.02195211 [24,] 9.269099 0.02187220 [25,] 9.269049 0.02179146 [26,] 9.268971 0.02171244 [27,] 9.268889 0.02163154 [28,] 9.268789 0.02155024 [29,] 9.268669 0.02146861 [30,] 9.268542 0.02138529 [31,] 9.268414 0.02130065 [32,] 9.268414 0.02121670 [33,] 9.268100 0.02114270 [34,] 9.267960 0.02107013 [35,] 9.267820 0.02099806 [36,] 9.267645 0.02092728 [37,] 9.267471 0.02085497 [38,] 9.267295 0.02078246 [39,] 9.267092 0.02071031 [40,] 9.266894 0.02063693 [41,] 9.266687 0.02056233 [42,] 9.266418 0.02049201 [43,] 9.266118 0.02042223 [44,] 9.265819 0.02035213 [45,] 9.265509 0.02028067 [46,] 9.265176 0.02020957 [47,] 9.264834 0.02013705 [48,] 9.264498 0.02006466 [49,] 9.264190 0.01999318 [50,] 9.263865 0.01992339 [51,] 9.263547 0.01985375 [52,] 9.263220 0.01978355 [53,] 9.262914 0.01971383 [54,] 9.262615 0.01964750 [55,] 9.262317 0.01958015 [56,] 9.262022 0.01951215 [57,] 9.261718 0.01944308 [58,] 9.261425 0.01937355 [59,] 9.261131 0.01930197 [60,] 9.260847 0.01922971 [61,] 9.260589 0.01916182 [62,] 9.260328 0.01909189 [63,] 9.260091 0.01902298 [64,] 9.260091 0.01895840 [65,] 9.259714 0.01889343 [66,] 9.259499 0.01882797 [67,] 9.259301 0.01876254 [68,] 9.259095 0.01869556 [69,] 9.258893 0.01862837 [70,] 9.258685 0.01856110 [71,] 9.258470 0.01849267 [72,] 9.258263 0.01842422 [73,] 9.258036 0.01835523 [74,] 9.257866 0.01829347 [75,] 9.257700 0.01823093 [76,] 9.257540 0.01816811 [77,] 9.257421 0.01811139 [78,] 9.257302 0.01805397 [79,] 9.257216 0.01799899 [80,] 9.257125 0.01794486 [81,] 9.257025 0.01789150 [82,] 9.256924 0.01783822 [83,] 9.256834 0.01778554 [84,] 9.256729 0.01773235 [85,] 9.256638 0.01768009 [86,] 9.256554 0.01762688 [87,] 9.256473 0.01757246 [88,] 9.256379 0.01751705 [89,] 9.256278 0.01746036 [90,] 9.256169 0.01740280 [91,] 9.256092 0.01734672 [92,] 9.256015 0.01729003 [93,] 9.255942 0.01723232 [94,] 9.255869 0.01717342 [95,] 9.255794 0.01711220 [96,] 9.255728 0.01704944 [97,] 9.255659 0.01698427 [98,] 9.255583 0.01691685 [99,] 9.255509 0.01684730 [100,] 9.255458 0.01677757 [101,] 9.255429 0.01670754 [102,] 9.255380 0.01663740 [103,] 9.255331 0.01656520 [104,] 9.255277 0.01649111 [105,] 9.255270 0.01642119 [106,] 9.255263 0.01634886 [107,] 9.255247 0.01627449 [108,] 9.255217 0.01619835 [109,] 9.255187 0.01611899 [110,] 9.255128 0.01603908 [111,] 9.255062 0.01595684 [112,] 9.254998 0.01587234 [113,] 9.254923 0.01578854 [114,] 9.254864 0.01570780 [115,] 9.254798 0.01562778 [116,] 9.254736 0.01554899 [117,] 9.254667 0.01546706 [118,] 9.254561 0.01538624 [119,] 9.254464 0.01530316 [120,] 9.254357 0.01521854 [121,] 9.254246 0.01513158 [122,] 9.254144 0.01504347 [123,] 9.254144 0.01495197 [124,] 9.253913 0.01486008 [125,] 9.253826 0.01476970 [126,] 9.253741 0.01468060 [127,] 9.253657 0.01458845 [128,] 9.253657 0.01449325 [129,] 9.253570 0.01440781 [130,] 9.253547 0.01432099 [131,] 9.253534 0.01423327 [132,] 9.253527 0.01414190 [133,] 9.253517 0.01404907 [134,] 9.253513 0.01395222 [135,] 9.253524 0.01385252 [136,] 9.253530 0.01375701 [137,] 9.253504 0.01366021 [138,] 9.253480 0.01355943 [139,] 9.253439 0.01345738 [140,] 9.253371 0.01335423 [141,] 9.253284 0.01324809 [142,] 9.253126 0.01315102 [143,] 9.252942 0.01305139 [144,] 9.252758 0.01294655 [145,] 9.252575 0.01284102 [146,] 9.252381 0.01273627 [147,] 9.252191 0.01263601 [148,] 9.251990 0.01253074 [149,] 9.251778 0.01242716 [150,] 9.251553 0.01231832 [151,] 9.251295 0.01221187 [152,] 9.251092 0.01210796 [153,] 9.250889 0.01200712 [154,] 9.250703 0.01190796 [155,] 9.250515 0.01180372 [156,] 9.250364 0.01170274 [157,] 9.250208 0.01159516 [158,] 9.250030 0.01148654 [159,] 9.249721 0.01138824 [160,] 9.249403 0.01128848 [161,] 9.249084 0.01118910 [162,] 9.248756 0.01108461 [163,] 9.248409 0.01097575 > (midr <- midrange(x)) [1] 9.2391 > midm <- array(NA,dim=8) > for (j in 1:8) midm[j] <- midmean(x,j) > midm [1] 9.252306 9.254144 9.254144 9.254144 9.254040 9.252306 9.254144 9.254144 > postscript(file="/var/www/rcomp/tmp/1blzm1291669503.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > lb <- win[,1] - 2*win[,2] > ub <- win[,1] + 2*win[,2] > if ((ylimmin == '') | (ylimmax == '')) plot(win[,1],type='b',main=main, xlab='j', pch=19, ylab='Winsorized Mean(j/n)', ylim=c(min(lb),max(ub))) else plot(win[,1],type='l',main=main, xlab='j', pch=19, ylab='Winsorized Mean(j/n)', ylim=c(ylimmin,ylimmax)) > lines(ub,lty=3) > lines(lb,lty=3) > grid() > dev.off() null device 1 > postscript(file="/var/www/rcomp/tmp/24cyp1291669503.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > lb <- tri[,1] - 2*tri[,2] > ub <- tri[,1] + 2*tri[,2] > if ((ylimmin == '') | (ylimmax == '')) plot(tri[,1],type='b',main=main, xlab='j', pch=19, ylab='Trimmed Mean(j/n)', ylim=c(min(lb),max(ub))) else plot(tri[,1],type='l',main=main, xlab='j', pch=19, ylab='Trimmed Mean(j/n)', ylim=c(ylimmin,ylimmax)) > lines(ub,lty=3) > lines(lb,lty=3) > grid() > 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,'Central Tendency - Ungrouped Data',4,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Measure',header=TRUE) > a<-table.element(a,'Value',header=TRUE) > a<-table.element(a,'S.E.',header=TRUE) > a<-table.element(a,'Value/S.E.',header=TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,hyperlink('http://www.xycoon.com/arithmetic_mean.htm', 'Arithmetic Mean', 'click to view the definition of the Arithmetic Mean'),header=TRUE) > a<-table.element(a,arm) > a<-table.element(a,hyperlink('http://www.xycoon.com/arithmetic_mean_standard_error.htm', armse, 'click to view the definition of the Standard Error of the Arithmetic Mean')) > a<-table.element(a,armose) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,hyperlink('http://www.xycoon.com/geometric_mean.htm', 'Geometric Mean', 'click to view the definition of the Geometric Mean'),header=TRUE) > a<-table.element(a,geo) > a<-table.element(a,'') > a<-table.element(a,'') > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,hyperlink('http://www.xycoon.com/harmonic_mean.htm', 'Harmonic Mean', 'click to view the definition of the Harmonic Mean'),header=TRUE) > a<-table.element(a,har) > a<-table.element(a,'') > a<-table.element(a,'') > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,hyperlink('http://www.xycoon.com/quadratic_mean.htm', 'Quadratic Mean', 'click to view the definition of the Quadratic Mean'),header=TRUE) > a<-table.element(a,qua) > a<-table.element(a,'') > a<-table.element(a,'') > a<-table.row.end(a) > for (j in 1:length(win[,1])) { + a<-table.row.start(a) + mylabel <- paste('Winsorized Mean (',j) + mylabel <- paste(mylabel,'/') + mylabel <- paste(mylabel,length(win[,1])) + mylabel <- paste(mylabel,')') + a<-table.element(a,hyperlink('http://www.xycoon.com/winsorized_mean.htm', mylabel, 'click to view the definition of the Winsorized Mean'),header=TRUE) + a<-table.element(a,win[j,1]) + a<-table.element(a,win[j,2]) + a<-table.element(a,win[j,1]/win[j,2]) + a<-table.row.end(a) + } > for (j in 1:length(tri[,1])) { + a<-table.row.start(a) + mylabel <- paste('Trimmed Mean (',j) + mylabel <- paste(mylabel,'/') + mylabel <- paste(mylabel,length(tri[,1])) + mylabel <- paste(mylabel,')') + a<-table.element(a,hyperlink('http://www.xycoon.com/arithmetic_mean.htm', mylabel, 'click to view the definition of the Trimmed Mean'),header=TRUE) + a<-table.element(a,tri[j,1]) + a<-table.element(a,tri[j,2]) + a<-table.element(a,tri[j,1]/tri[j,2]) + a<-table.row.end(a) + } > a<-table.row.start(a) > a<-table.element(a,hyperlink('http://www.xycoon.com/median_1.htm', 'Median', 'click to view the definition of the Median'),header=TRUE) > a<-table.element(a,median(x)) > a<-table.element(a,'') > a<-table.element(a,'') > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,hyperlink('http://www.xycoon.com/midrange.htm', 'Midrange', 'click to view the definition of the Midrange'),header=TRUE) > a<-table.element(a,midr) > a<-table.element(a,'') > a<-table.element(a,'') > a<-table.row.end(a) > a<-table.row.start(a) > mymid <- hyperlink('http://www.xycoon.com/midmean.htm', 'Midmean', 'click to view the definition of the Midmean') > mylabel <- paste(mymid,hyperlink('http://www.xycoon.com/method_1.htm','Weighted Average at Xnp',''),sep=' - ') > a<-table.element(a,mylabel,header=TRUE) > a<-table.element(a,midm[1]) > a<-table.element(a,'') > a<-table.element(a,'') > a<-table.row.end(a) > a<-table.row.start(a) > mymid <- hyperlink('http://www.xycoon.com/midmean.htm', 'Midmean', 'click to view the definition of the Midmean') > mylabel <- paste(mymid,hyperlink('http://www.xycoon.com/method_2.htm','Weighted Average at X(n+1)p',''),sep=' - ') > a<-table.element(a,mylabel,header=TRUE) > a<-table.element(a,midm[2]) > a<-table.element(a,'') > a<-table.element(a,'') > a<-table.row.end(a) > a<-table.row.start(a) > mymid <- hyperlink('http://www.xycoon.com/midmean.htm', 'Midmean', 'click to view the definition of the Midmean') > mylabel <- paste(mymid,hyperlink('http://www.xycoon.com/method_3.htm','Empirical Distribution Function',''),sep=' - ') > a<-table.element(a,mylabel,header=TRUE) > a<-table.element(a,midm[3]) > a<-table.element(a,'') > a<-table.element(a,'') > a<-table.row.end(a) > a<-table.row.start(a) > mymid <- hyperlink('http://www.xycoon.com/midmean.htm', 'Midmean', 'click to view the definition of the Midmean') > mylabel <- paste(mymid,hyperlink('http://www.xycoon.com/method_4.htm','Empirical Distribution Function - Averaging',''),sep=' - ') > a<-table.element(a,mylabel,header=TRUE) > a<-table.element(a,midm[4]) > a<-table.element(a,'') > a<-table.element(a,'') > a<-table.row.end(a) > a<-table.row.start(a) > mymid <- hyperlink('http://www.xycoon.com/midmean.htm', 'Midmean', 'click to view the definition of the Midmean') > mylabel <- paste(mymid,hyperlink('http://www.xycoon.com/method_5.htm','Empirical Distribution Function - Interpolation',''),sep=' - ') > a<-table.element(a,mylabel,header=TRUE) > a<-table.element(a,midm[5]) > a<-table.element(a,'') > a<-table.element(a,'') > a<-table.row.end(a) > a<-table.row.start(a) > mymid <- hyperlink('http://www.xycoon.com/midmean.htm', 'Midmean', 'click to view the definition of the Midmean') > mylabel <- paste(mymid,hyperlink('http://www.xycoon.com/method_6.htm','Closest Observation',''),sep=' - ') > a<-table.element(a,mylabel,header=TRUE) > a<-table.element(a,midm[6]) > a<-table.element(a,'') > a<-table.element(a,'') > a<-table.row.end(a) > a<-table.row.start(a) > mymid <- hyperlink('http://www.xycoon.com/midmean.htm', 'Midmean', 'click to view the definition of the Midmean') > mylabel <- paste(mymid,hyperlink('http://www.xycoon.com/method_7.htm','True Basic - Statistics Graphics Toolkit',''),sep=' - ') > a<-table.element(a,mylabel,header=TRUE) > a<-table.element(a,midm[7]) > a<-table.element(a,'') > a<-table.element(a,'') > a<-table.row.end(a) > a<-table.row.start(a) > mymid <- hyperlink('http://www.xycoon.com/midmean.htm', 'Midmean', 'click to view the definition of the Midmean') > mylabel <- paste(mymid,hyperlink('http://www.xycoon.com/method_8.htm','MS Excel (old versions)',''),sep=' - ') > a<-table.element(a,mylabel,header=TRUE) > a<-table.element(a,midm[8]) > a<-table.element(a,'') > a<-table.element(a,'') > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Number of observations',header=TRUE) > a<-table.element(a,length(x)) > a<-table.element(a,'') > a<-table.element(a,'') > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/www/rcomp/tmp/3of761291669503.tab") > > try(system("convert tmp/1blzm1291669503.ps tmp/1blzm1291669503.png",intern=TRUE)) character(0) > try(system("convert tmp/24cyp1291669503.ps tmp/24cyp1291669503.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.120 0.370 3.485