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(1.3866 + ,1.3582 + ,1.3332 + ,1.3595 + ,1.3617 + ,1.3684 + ,1.3394 + ,1.3262 + ,1.3173 + ,1.3085 + ,1.327 + ,1.3182 + ,1.293 + ,1.291 + ,1.2984 + ,1.2795 + ,1.299 + ,1.3174 + ,1.326 + ,1.3111 + ,1.2816 + ,1.276 + ,1.2849 + ,1.2818 + ,1.2829 + ,1.2796 + ,1.3008 + ,1.2967 + ,1.2938 + ,1.2833 + ,1.2823 + ,1.2765 + ,1.2634 + ,1.2596 + ,1.2705 + ,1.2591 + ,1.2798 + ,1.2763 + ,1.2795 + ,1.2782 + ,1.2644 + ,1.2596 + ,1.2615 + ,1.2555 + ,1.2555 + ,1.2658 + ,1.2565 + ,1.2783 + ,1.2786 + ,1.2782 + ,1.2905 + ,1.3042 + ,1.2942 + ,1.313 + ,1.3671 + ,1.3549 + ,1.3558 + ,1.3507 + ,1.3494 + ,1.3607 + ,1.3295 + ,1.3193 + ,1.3308 + ,1.3246 + ,1.3392 + ,1.3425 + ,1.3496 + ,1.3255 + ,1.3231 + ,1.3273 + ,1.3276 + ,1.3173 + ,1.3196 + ,1.3058 + ,1.2966 + ,1.2932 + ,1.2947 + ,1.305 + ,1.3232 + ,1.3125 + ,1.2992 + ,1.3266 + ,1.3275 + ,1.3223 + ,1.3403 + ,1.3322 + ,1.3363 + ,1.3425 + ,1.3574 + ,1.3683 + ,1.3623 + ,1.3563 + ,1.3518 + ,1.3494 + ,1.3612 + ,1.369 + ,1.3771 + ,1.3972 + ,1.401 + ,1.3908 + ,1.3901 + ,1.3856 + ,1.4098 + ,1.422 + ,1.4238 + ,1.4207 + ,1.4095 + ,1.4177 + ,1.3866 + ,1.3959 + ,1.4102 + ,1.3969 + ,1.4004 + ,1.385 + ,1.389 + ,1.384 + ,1.392 + ,1.3932 + ,1.3858 + ,1.3978 + ,1.4029 + ,1.394 + ,1.4096 + ,1.4058 + ,1.4134 + ,1.4096 + ,1.4049 + ,1.4009 + ,1.3897 + ,1.4019 + ,1.3901 + ,1.399 + ,1.3901 + ,1.3975 + ,1.3991 + ,1.4089 + ,1.413 + ,1.409 + ,1.4217 + ,1.4223 + ,1.4191 + ,1.4229 + ,1.4227 + ,1.4269 + ,1.4229 + ,1.4104 + ,1.4053 + ,1.4138 + ,1.4303 + ,1.4384 + ,1.441 + ,1.437 + ,1.4357 + ,1.4202 + ,1.4166 + ,1.417 + ,1.4293 + ,1.4294 + ,1.4072 + ,1.4101 + ,1.4112 + ,1.4243 + ,1.433 + ,1.4323 + ,1.4324 + ,1.427 + ,1.4268 + ,1.4364 + ,1.4272 + ,1.4314 + ,1.422 + ,1.4335 + ,1.4262 + ,1.433 + ,1.4473 + ,1.4522 + ,1.4545 + ,1.4594 + ,1.4561 + ,1.4611 + ,1.4671 + ,1.4712 + ,1.4705 + ,1.4658 + ,1.478 + ,1.4783 + ,1.4768 + ,1.467 + ,1.465 + ,1.4549 + ,1.4643 + ,1.4539 + ,1.4537 + ,1.4616 + ,1.4722 + ,1.4694 + ,1.4763 + ,1.475 + ,1.4765 + ,1.4864 + ,1.4881 + ,1.4864 + ,1.4869 + ,1.4918 + ,1.4971 + ,1.4921 + ,1.5 + ,1.502 + ,1.5019 + ,1.4874 + ,1.4785 + ,1.4788 + ,1.48 + ,1.4772 + ,1.4658 + ,1.4761 + ,1.4867 + ,1.4862 + ,1.4984 + ,1.4966 + ,1.5037 + ,1.4922 + ,1.4868 + ,1.4965 + ,1.4875 + ,1.4957 + ,1.4863 + ,1.4815 + ,1.4968 + ,1.4969 + ,1.5083 + ,1.5071 + ,1.4918 + ,1.5023 + ,1.5074 + ,1.509 + ,1.512 + ,1.5068 + ,1.4787 + ,1.4774 + ,1.4768 + ,1.473 + ,1.4757 + ,1.4647 + ,1.4541 + ,1.456 + ,1.4343 + ,1.4337 + ,1.4368 + ,1.4279 + ,1.4276 + ,1.4398 + ,1.4405 + ,1.4433 + ,1.4338 + ,1.4406 + ,1.4389 + ,1.4442 + ,1.435 + ,1.4304 + ,1.4273 + ,1.4528 + ,1.4481 + ,1.4563 + ,1.4486 + ,1.4374 + ,1.4369 + ,1.4279 + ,1.4132 + ,1.4064 + ,1.4135 + ,1.4151 + ,1.4085 + ,1.4072 + ,1.3999 + ,1.3966 + ,1.3913 + ,1.3937 + ,1.3984 + ,1.3847 + ,1.3691 + ,1.3675 + ,1.376 + ,1.374 + ,1.3718 + ,1.3572 + ,1.3607 + ,1.3649 + ,1.3726 + ,1.3567 + ,1.3519 + ,1.3626 + ,1.3577 + ,1.3547 + ,1.3489 + ,1.357 + ,1.3525 + ,1.3548 + ,1.3641 + ,1.3668 + ,1.3582 + ,1.3662 + ,1.3557 + ,1.361 + ,1.3657 + ,1.3765 + ,1.3705 + ,1.3723 + ,1.3756 + ,1.366 + ,1.3548 + ,1.3471 + ,1.3519 + ,1.3338 + ,1.3356 + ,1.3353 + ,1.3471 + ,1.3482 + ,1.3479 + ,1.3468 + ,1.3396 + ,1.334 + ,1.3296 + ,1.3384 + ,1.3585 + ,1.3583 + ,1.3615 + ,1.3544 + ,1.3535 + ,1.3432 + ,1.3486 + ,1.3373 + ,1.3339 + ,1.3311 + ,1.3321 + ,1.329 + ,1.3245 + ,1.3256 + ,1.3315 + ,1.3238 + ,1.3089 + ,1.2924 + ,1.2727 + ,1.2746 + ,1.2969 + ,1.2698 + ,1.2686 + ,1.2587 + ,1.2492 + ,1.2349 + ,1.2428 + ,1.227 + ,1.2334 + ,1.2497 + ,1.236 + ,1.2223 + ,1.2309 + ,1.2255 + ,1.2384 + ,1.2307 + ,1.2155 + ,1.2218 + ,1.2268 + ,1.206 + ,1.1959 + ,1.1942 + ,1.201 + ,1.2045 + ,1.2127 + ,1.2249 + ,1.2258 + ,1.2277 + ,1.2363 + ,1.2372 + ,1.2391 + ,1.2258 + ,1.2271 + ,1.2262 + ,1.2294 + ,1.2339 + ,1.2198 + ,1.2271 + ,1.2328 + ,1.2548 + ,1.2531 + ,1.2579 + ,1.2567 + ,1.266 + ,1.2637 + ,1.2572 + ,1.2569 + ,1.2703 + ,1.2828 + ,1.3 + ,1.2957 + ,1.2844 + ,1.2817 + ,1.285 + ,1.2897 + ,1.2931 + ,1.3033 + ,1.2992 + ,1.3069 + ,1.3028 + ,1.3073 + ,1.3221 + ,1.3206 + ,1.3184 + ,1.3176 + ,1.3253 + ,1.3133 + ,1.3016 + ,1.279 + ,1.2799 + ,1.282 + ,1.286 + ,1.288 + ,1.2836 + ,1.2711 + ,1.2704 + ,1.2611 + ,1.2613 + ,1.2693 + ,1.2713 + ,1.27 + ,1.268 + ,1.28 + ,1.2818 + ,1.2834 + ,1.2874 + ,1.2744 + ,1.2697 + ,1.2715 + ,1.2725 + ,1.2801 + ,1.285 + ,1.2989 + ,1.3078 + ,1.306 + ,1.3074 + ,1.312 + ,1.3364 + ,1.3323 + ,1.3412 + ,1.3477 + ,1.346 + ,1.3611 + ,1.3648 + ,1.3726 + ,1.3705 + ,1.378 + ,1.3856 + ,1.397 + ,1.3874 + ,1.3936 + ,1.3833 + ,1.3958 + ,1.4101 + ,1.4089 + ,1.3896 + ,1.3859 + ,1.3861 + ,1.4016 + ,1.3934 + ,1.4031 + ,1.3912 + ,1.3803 + ,1.3857 + ,1.3857 + ,1.3926 + ,1.4018 + ,1.4014 + ,1.4244 + ,1.4084 + ,1.3917 + ,1.3945 + ,1.377 + ,1.37 + ,1.3711 + ,1.3626 + ,1.3612 + ,1.3481 + ,1.3647 + ,1.3674 + ,1.3647 + ,1.3496 + ,1.3339 + ,1.3321 + ,1.3225 + ,1.3146 + ,1.2998) > 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] 1.3619 > sqrtn <- sqrt(length(x)) > (armse <- sd(x) / sqrtn) [1] 0.003451366 > (armose <- arm / armse) [1] 394.5973 > (geo <- geomean(x)) [1] 1.359751 > (har <- harmean(x)) [1] 1.357596 > (qua <- quamean(x)) [1] 1.364041 > (win <- winmean(x)) [,1] [,2] [1,] 1.361897 0.003450488 [2,] 1.361915 0.003448231 [3,] 1.361931 0.003445741 [4,] 1.361941 0.003444396 [5,] 1.362006 0.003437958 [6,] 1.362002 0.003431727 [7,] 1.362044 0.003424783 [8,] 1.362071 0.003421631 [9,] 1.362079 0.003420712 [10,] 1.362093 0.003413123 [11,] 1.362071 0.003409081 [12,] 1.362046 0.003405900 [13,] 1.362041 0.003405472 [14,] 1.362049 0.003404312 [15,] 1.362062 0.003402328 [16,] 1.362065 0.003401537 [17,] 1.362041 0.003399028 [18,] 1.361912 0.003388846 [19,] 1.361932 0.003386661 [20,] 1.361989 0.003380130 [21,] 1.362044 0.003375697 [22,] 1.361888 0.003362132 [23,] 1.361948 0.003352945 [24,] 1.361973 0.003350270 [25,] 1.361973 0.003346337 [26,] 1.362021 0.003341810 [27,] 1.362076 0.003336711 [28,] 1.362076 0.003334089 [29,] 1.362129 0.003330008 [30,] 1.362196 0.003323950 [31,] 1.362234 0.003320116 [32,] 1.362169 0.003278984 [33,] 1.362498 0.003240180 [34,] 1.362449 0.003231584 [35,] 1.362685 0.003213999 [36,] 1.362795 0.003204295 [37,] 1.362832 0.003199565 [38,] 1.362809 0.003197856 [39,] 1.362841 0.003188935 [40,] 1.362841 0.003186633 [41,] 1.362824 0.003183055 [42,] 1.362850 0.003181314 [43,] 1.362885 0.003175248 [44,] 1.362939 0.003169115 [45,] 1.362957 0.003165320 [46,] 1.362966 0.003159456 [47,] 1.362899 0.003154587 [48,] 1.362851 0.003130714 [49,] 1.362791 0.003123671 [50,] 1.362709 0.003115062 [51,] 1.362834 0.003096889 [52,] 1.362749 0.003086568 [53,] 1.362576 0.003064228 [54,] 1.362719 0.003053441 [55,] 1.362607 0.003042653 [56,] 1.362835 0.003027972 [57,] 1.362812 0.003017095 [58,] 1.362859 0.003009388 [59,] 1.362859 0.003003025 [60,] 1.362542 0.002979685 [61,] 1.362504 0.002973898 [62,] 1.362328 0.002957040 [63,] 1.361943 0.002929826 [64,] 1.361930 0.002927283 [65,] 1.361996 0.002921360 [66,] 1.361875 0.002909975 [67,] 1.361848 0.002904685 [68,] 1.361931 0.002892315 [69,] 1.361931 0.002888715 [70,] 1.362145 0.002871665 [71,] 1.362043 0.002861416 [72,] 1.362161 0.002842974 [73,] 1.361670 0.002805990 [74,] 1.361625 0.002799362 [75,] 1.361762 0.002775632 [76,] 1.361282 0.002745755 [77,] 1.361157 0.002736113 [78,] 1.360839 0.002710947 [79,] 1.360839 0.002703087 [80,] 1.360904 0.002697080 [81,] 1.360789 0.002690141 [82,] 1.360655 0.002680129 [83,] 1.360605 0.002673014 [84,] 1.360451 0.002661831 [85,] 1.360399 0.002656682 [86,] 1.360399 0.002654570 [87,] 1.360647 0.002637194 [88,] 1.360593 0.002631878 [89,] 1.360484 0.002623327 [90,] 1.360356 0.002615837 [91,] 1.360263 0.002606026 [92,] 1.360226 0.002597159 [93,] 1.360302 0.002590273 [94,] 1.360282 0.002586891 [95,] 1.360263 0.002576589 [96,] 1.360283 0.002575397 [97,] 1.360204 0.002566172 [98,] 1.360343 0.002555319 [99,] 1.360263 0.002538806 [100,] 1.360079 0.002525962 [101,] 1.360059 0.002524794 [102,] 1.360080 0.002501620 [103,] 1.360352 0.002482752 [104,] 1.360183 0.002458396 [105,] 1.360546 0.002436718 [106,] 1.360654 0.002422838 [107,] 1.360698 0.002412722 [108,] 1.360984 0.002393399 [109,] 1.361073 0.002383116 [110,] 1.361073 0.002380545 [111,] 1.361073 0.002377953 [112,] 1.361073 0.002362279 [113,] 1.360751 0.002333741 [114,] 1.360843 0.002325702 [115,] 1.360960 0.002305622 [116,] 1.360960 0.002281557 [117,] 1.360984 0.002280185 [118,] 1.360984 0.002274759 [119,] 1.361251 0.002248569 [120,] 1.361300 0.002237545 [121,] 1.361324 0.002236143 [122,] 1.361300 0.002229192 [123,] 1.361049 0.002215383 [124,] 1.361074 0.002199827 [125,] 1.360845 0.002181620 [126,] 1.360691 0.002150435 [127,] 1.360717 0.002128908 [128,] 1.360926 0.002105605 [129,] 1.360663 0.002077030 [130,] 1.360557 0.002045265 [131,] 1.360690 0.002029034 [132,] 1.360879 0.002015585 [133,] 1.360879 0.002009685 [134,] 1.361070 0.001993128 [135,] 1.360685 0.001960853 [136,] 1.360491 0.001947694 [137,] 1.360547 0.001938574 [138,] 1.360715 0.001926199 [139,] 1.360829 0.001919942 [140,] 1.361370 0.001881033 [141,] 1.361571 0.001863952 [142,] 1.361716 0.001856116 [143,] 1.361832 0.001846713 [144,] 1.361774 0.001834251 [145,] 1.362128 0.001812069 [146,] 1.362931 0.001769451 [147,] 1.362811 0.001763110 [148,] 1.362811 0.001759928 [149,] 1.362508 0.001737546 [150,] 1.362691 0.001727896 [151,] 1.362507 0.001711758 [152,] 1.362599 0.001687425 [153,] 1.362537 0.001674400 [154,] 1.362725 0.001651491 [155,] 1.362631 0.001597406 [156,] 1.362631 0.001590833 [157,] 1.362375 0.001571054 [158,] 1.362536 0.001559418 [159,] 1.362503 0.001554421 [160,] 1.362634 0.001541003 [161,] 1.362732 0.001522488 [162,] 1.362732 0.001519106 [163,] 1.362798 0.001498715 > (tri <- trimean(x)) [,1] [,2] [1,] 1.361900 0.003434734 [2,] 1.361936 0.003418587 [3,] 1.362005 0.003403207 [4,] 1.362005 0.003388314 [5,] 1.362053 0.003373402 [6,] 1.362063 0.003359500 [7,] 1.362073 0.003346374 [8,] 1.362073 0.003334003 [9,] 1.362078 0.003321753 [10,] 1.362078 0.003309301 [11,] 1.362076 0.003297390 [12,] 1.362077 0.003285589 [13,] 1.362080 0.003273788 [14,] 1.362083 0.003261715 [15,] 1.362085 0.003249422 [16,] 1.362085 0.003236962 [17,] 1.362088 0.003224232 [18,] 1.362091 0.003211344 [19,] 1.362102 0.003198816 [20,] 1.362112 0.003186095 [21,] 1.362119 0.003173447 [22,] 1.362123 0.003160728 [23,] 1.362134 0.003148465 [24,] 1.362143 0.003136391 [25,] 1.362151 0.003124132 [26,] 1.362159 0.003111745 [27,] 1.362165 0.003099251 [28,] 1.362169 0.003086669 [29,] 1.362173 0.003073865 [30,] 1.362174 0.003060898 [31,] 1.362174 0.003047854 [32,] 1.362174 0.003034617 [33,] 1.362172 0.003022877 [34,] 1.362160 0.003012512 [35,] 1.362150 0.003002215 [36,] 1.362132 0.002992355 [37,] 1.362111 0.002982603 [38,] 1.362087 0.002972750 [39,] 1.362065 0.002962670 [40,] 1.362041 0.002952640 [41,] 1.362017 0.002942394 [42,] 1.361993 0.002931976 [43,] 1.361969 0.002921306 [44,] 1.361943 0.002910537 [45,] 1.361915 0.002899665 [46,] 1.361886 0.002888598 [47,] 1.361857 0.002877401 [48,] 1.361830 0.002866035 [49,] 1.361803 0.002855169 [50,] 1.361778 0.002844212 [51,] 1.361754 0.002833213 [52,] 1.361728 0.002822492 [53,] 1.361703 0.002811785 [54,] 1.361681 0.002801498 [55,] 1.361657 0.002791236 [56,] 1.361634 0.002781003 [57,] 1.361606 0.002770914 [58,] 1.361579 0.002760849 [59,] 1.361550 0.002750700 [60,] 1.361520 0.002740417 [61,] 1.361498 0.002730552 [62,] 1.361475 0.002720537 [63,] 1.361457 0.002710724 [64,] 1.361457 0.002701440 [65,] 1.361436 0.002691912 [66,] 1.361425 0.002682237 [67,] 1.361415 0.002672580 [68,] 1.361406 0.002662747 [69,] 1.361395 0.002652950 [70,] 1.361385 0.002642916 [71,] 1.361369 0.002633048 [72,] 1.361356 0.002623141 [73,] 1.361340 0.002613440 [74,] 1.361334 0.002604517 [75,] 1.361328 0.002595462 [76,] 1.361319 0.002586784 [77,] 1.361320 0.002578672 [78,] 1.361323 0.002570533 [79,] 1.361332 0.002562820 [80,] 1.361342 0.002555034 [81,] 1.361350 0.002547115 [82,] 1.361360 0.002539083 [83,] 1.361373 0.002531023 [84,] 1.361387 0.002522846 [85,] 1.361404 0.002514665 [86,] 1.361423 0.002506302 [87,] 1.361441 0.002497658 [88,] 1.361455 0.002489182 [89,] 1.361471 0.002480511 [90,] 1.361488 0.002471734 [91,] 1.361508 0.002462810 [92,] 1.361530 0.002453803 [93,] 1.361553 0.002444682 [94,] 1.361575 0.002435385 [95,] 1.361597 0.002425794 [96,] 1.361620 0.002416106 [97,] 1.361643 0.002406041 [98,] 1.361668 0.002395824 [99,] 1.361690 0.002385507 [100,] 1.361715 0.002375249 [101,] 1.361743 0.002364934 [102,] 1.361771 0.002354200 [103,] 1.361800 0.002343717 [104,] 1.361824 0.002333369 [105,] 1.361852 0.002323309 [106,] 1.361873 0.002313484 [107,] 1.361894 0.002303644 [108,] 1.361914 0.002293667 [109,] 1.361929 0.002283844 [110,] 1.361944 0.002273886 [111,] 1.361958 0.002263538 [112,] 1.361973 0.002252782 [113,] 1.361988 0.002242024 [114,] 1.362008 0.002231667 [115,] 1.362027 0.002221073 [116,] 1.362045 0.002210623 [117,] 1.362063 0.002200447 [118,] 1.362080 0.002189809 [119,] 1.362098 0.002178819 [120,] 1.362112 0.002168166 [121,] 1.362126 0.002157343 [122,] 1.362139 0.002146014 [123,] 1.362139 0.002134343 [124,] 1.362171 0.002122543 [125,] 1.362189 0.002110676 [126,] 1.362211 0.002098822 [127,] 1.362236 0.002087437 [128,] 1.362236 0.002076206 [129,] 1.362283 0.002065207 [130,] 1.362310 0.002054611 [131,] 1.362338 0.002044552 [132,] 1.362366 0.002034510 [133,] 1.362390 0.002024388 [134,] 1.362415 0.002013894 [135,] 1.362438 0.002003412 [136,] 1.362467 0.001993486 [137,] 1.362500 0.001983439 [138,] 1.362532 0.001973131 [139,] 1.362562 0.001962679 [140,] 1.362591 0.001951836 [141,] 1.362612 0.001941866 [142,] 1.362629 0.001931939 [143,] 1.362645 0.001921694 [144,] 1.362659 0.001911170 [145,] 1.362674 0.001900468 [146,] 1.362683 0.001889984 [147,] 1.362679 0.001880548 [148,] 1.362676 0.001870730 [149,] 1.362674 0.001860373 [150,] 1.362677 0.001850251 [151,] 1.362677 0.001839836 [152,] 1.362680 0.001829388 [153,] 1.362681 0.001819260 [154,] 1.362684 0.001808973 [155,] 1.362683 0.001798956 [156,] 1.362684 0.001790589 [157,] 1.362685 0.001781857 [158,] 1.362690 0.001773324 [159,] 1.362693 0.001764636 [160,] 1.362696 0.001755477 [161,] 1.362698 0.001746208 [162,] 1.362697 0.001737062 [163,] 1.362696 0.001727319 > (midr <- midrange(x)) [1] 1.3531 > midm <- array(NA,dim=8) > for (j in 1:8) midm[j] <- midmean(x,j) > midm [1] 1.361897 1.362139 1.362139 1.362139 1.361897 1.361897 1.362139 1.362139 > postscript(file="/var/www/html/rcomp/tmp/1h99k1292334058.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/html/rcomp/tmp/2h99k1292334058.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/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,'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/html/rcomp/tmp/3kc0j1292334058.tab") > > try(system("convert tmp/1h99k1292334058.ps tmp/1h99k1292334058.png",intern=TRUE)) character(0) > try(system("convert tmp/2h99k1292334058.ps tmp/2h99k1292334058.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.972 0.404 6.820