R version 2.8.0 (2008-10-20) Copyright (C) 2008 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. Natural language support but running in an English locale 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(109 + ,110.73 + ,110.92 + ,111.35 + ,111.28 + ,112.5 + ,113.97 + ,114.09 + ,113.72 + ,112.5 + ,113.21 + ,113.31 + ,112.59 + ,112.78 + ,113.48 + ,112.44 + ,112.88 + ,114.41 + ,115.15 + ,113.67 + ,113.18 + ,111.94 + ,111.87 + ,112.57 + ,112.78 + ,113.11 + ,113.21 + ,113.18 + ,113.65 + ,112.59 + ,113.16 + ,113 + ,114.28 + ,114.43 + ,114.23 + ,113.35 + ,114.24 + ,114.21 + ,115.1 + ,114.98 + ,114.8 + ,114.1 + ,114.26 + ,113.68 + ,113.85 + ,113.22 + ,113.52 + ,113.2 + ,112.49 + ,113.14 + ,112.05 + ,112.07 + ,111.98 + ,111.93 + ,111.04 + ,107.04 + ,107.69 + ,106.84 + ,106.46 + ,106.41 + ,106.86 + ,108.42 + ,108.38 + ,107.81 + ,107.54 + ,107.07 + ,107.54 + ,107.74 + ,107.15 + ,106.49 + ,106.19 + ,108.23 + ,108.54 + ,109.82 + ,109.93 + ,109.66 + ,109.49 + ,109.78 + ,109.5 + ,110.56 + ,113.23 + ,113.48 + ,113.14 + ,113.66 + ,112.92 + ,113.51 + ,113.27 + ,112.62 + ,113.64 + ,114.01 + ,113.79 + ,112.31 + ,112.48 + ,111.57 + ,111.52 + ,111.5 + ,112.84 + ,112.54 + ,113.11 + ,112.49 + ,110.95 + ,111.35 + ,111.85 + ,111.49 + ,109.56 + ,110.46 + ,109.93 + ,109.88 + ,108.14 + ,108.79 + ,108.31 + ,110.25 + ,109.99 + ,109.59 + ,110.76 + ,111.09 + ,113.1 + ,112.12 + ,112.89 + ,112.15 + ,111.77 + ,112.43 + ,111.13 + ,109.84 + ,109.99 + ,109.32 + ,109.86 + ,111.73 + ,113.74 + ,112.36 + ,110.65 + ,112.62 + ,113.06 + ,110.79 + ,111.35 + ,109.53 + ,111.63 + ,112.08 + ,111.93 + ,112.49 + ,115.32 + ,114.17 + ,115.55 + ,116.99 + ,118.06 + ,117.38 + ,120.97 + ,117.84 + ,119.34 + ,122.66 + ,123.66 + ,124.95 + ,125.81 + ,124.76 + ,124.48 + ,124.7 + ,125.46 + ,125.11 + ,124.03 + ,124.65 + ,125.32 + ,123.5 + ,125.3 + ,126.18 + ,127.42 + ,126.34 + ,126.99 + ,125.34 + ,123.76 + ,125.04 + ,126.04 + ,126.28 + ,125.93 + ,124.8 + ,124.75 + ,124 + ,123.44 + ,122.62 + ,122.16 + ,121.25 + ,122.86 + ,123.33 + ,124.43 + ,124.22 + ,124.3 + ,124.57 + ,123.84 + ,123.16 + ,121.72 + ,123.48 + ,121.48 + ,120.86 + ,121.1 + ,120.68 + ,120.67 + ,120.92 + ,120.66 + ,122.16 + ,123.19 + ,124.38 + ,124.17 + ,123.3 + ,124.69 + ,122.68 + ,122.42 + ,122.33 + ,123.03 + ,123.01 + ,123.4 + ,122.07 + ,122.49 + ,125.68 + ,126.73 + ,126.2 + ,125.6 + ,126.15 + ,126.36 + ,125.95 + ,126.31 + ,127.74 + ,127.35 + ,129.14 + ,128.65 + ,129.79 + ,130.33 + ,130.76 + ,132.88 + ,133.02 + ,132.41 + ,134.23 + ,133.36 + ,133.5 + ,132.69 + ,132.54 + ,133.62 + ,133.16 + ,132.35 + ,132.44 + ,131.86 + ,131.73 + ,130.95 + ,130.83 + ,130.1 + ,129.68 + ,129.27 + ,130.61 + ,130.22 + ,129.55 + ,131.13 + ,130.03 + ,129.91 + ,130.74 + ,133.24 + ,133.08 + ,133.17 + ,131.55 + ,131.02 + ,129.77 + ,129.2 + ,130.7 + ,132.1 + ,132.57 + ,133.03 + ,131.87 + ,132.05 + ,133.39 + ,132.76 + ,134.02 + ,133.51 + ,134.32 + ,135.11 + ,134.51 + ,134.81 + ,134.76 + ,134.3 + ,134.3 + ,132.25 + ,132.95 + ,134.66 + ,135.13 + ,134.76 + ,136.91 + ,138.09 + ,137.97 + ,136.9 + ,135.82 + ,135.53 + ,135.66 + ,135.6 + ,134.07 + ,133.39 + ,133.02 + ,132.99 + ,131.12 + ,130.46 + ,130.68 + ,131.21 + ,131.41 + ,129.95 + ,130.78 + ,131.07 + ,130.91 + ,131.15 + ,132.59 + ,133.85 + ,134.96 + ,135.09 + ,135.46 + ,134.17 + ,134.38 + ,132.6 + ,133.26 + ,132.3 + ,132.62 + ,133.92 + ,134.13 + ,133.57 + ,133.33 + ,132.45 + ,132.47 + ,131.63 + ,133.26 + ,133.1 + ,134.75 + ,133.61 + ,134.32 + ,135.05 + ,135.57 + ,134.19 + ,134.11 + ,132.55 + ,134.12 + ,132.94 + ,135.61 + ,137.52 + ,135.77 + ,136.72 + ,138.01 + ,136.89 + ,137.31 + ,137.38 + ,136.22 + ,135.86 + ,135.33 + ,133.89 + ,133.86 + ,134.53 + ,135.61 + ,134.92 + ,134.23 + ,132.49 + ,134.1 + ,134.44 + ,132.06 + ,132.63 + ,131.57 + ,130.34 + ,129.03 + ,128.21 + ,130.05 + ,131.02 + ,133.61 + ,132.44 + ,134.32 + ,135.95 + ,136.53 + ,135.51 + ,134.03 + ,134.5 + ,134.34 + ,133.77 + ,133.49 + ,133.02 + ,134.84 + ,133.57 + ,133.28 + ,134.78 + ,136.08 + ,137.55 + ,137.39 + ,138.03 + ,136.8 + ,136.53 + ,137.48 + ,136.32 + ,136.33 + ,136.09 + ,134.89 + ,135.22 + ,134.38 + ,132.48 + ,132.06 + ,133.22 + ,131.41 + ,130.84 + ,131.06 + ,130.91 + ,129.28 + ,128.67 + ,129.41 + ,130.9 + ,132.9 + ,132.82 + ,133.36 + ,132.72 + ,131.17 + ,132.59 + ,131.52 + ,130.34 + ,128.53 + ,125.08 + ,126.82 + ,128.3 + ,128.28 + ,126.85 + ,126.82 + ,127.8 + ,129.67 + ,130.5 + ,130.7 + ,132.57 + ,133.05 + ,132.37 + ,132.8 + ,136.02 + ,134.08 + ,133.48 + ,130.86 + ,131.17 + ,127.93 + ,129.91 + ,133.63 + ,132.24 + ,132.68 + ,131.12 + ,129.87 + ,129.67 + ,128.94 + ,128.1 + ,128.51 + ,127.03 + ,124.3 + ,125.35 + ,125.45 + ,124.4 + ,122.53 + ,124.71 + ,124.67 + ,123.64 + ,122.52 + ,123.23 + ,125.33 + ,123.76 + ,122.4 + ,121.09 + ,118.62 + ,118.99 + ,116.83 + ,116.2 + ,117.33 + ,117.59 + ,115.46 + ,116.5 + ,118.39 + ,119.21 + ,116.7 + ,115.04 + ,114.28 + ,115.02 + ,114.04 + ,114.98 + ,118.07 + ,118.57 + ,117.59 + ,115.82 + ,113.65 + ,114.98 + ,116.11 + ,116.9 + ,119.16 + ,120.11 + ,116.97 + ,117.66 + ,118.54 + ,120.48 + ,124.4 + ,124.34 + ,126.77 + ,125.84 + ,126.81 + ,126.64) > 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] 123.8762 > sqrtn <- sqrt(length(x)) > (armse <- sd(x) / sqrtn) [1] 0.4230923 > (armose <- arm / armse) [1] 292.7876 > (geo <- geomean(x)) [1] 123.5161 > (har <- harmean(x)) [1] 123.1509 > (qua <- quamean(x)) [1] 124.2297 > (win <- winmean(x)) [,1] [,2] [1,] 123.8765 0.4230459 [2,] 123.8766 0.4230232 [3,] 123.8766 0.4229912 [4,] 123.8760 0.4225250 [5,] 123.8759 0.4224881 [6,] 123.8776 0.4222760 [7,] 123.8767 0.4221571 [8,] 123.8779 0.4220408 [9,] 123.8837 0.4213852 [10,] 123.8756 0.4208628 [11,] 123.8787 0.4205836 [12,] 123.8797 0.4204723 [13,] 123.8792 0.4201774 [14,] 123.8863 0.4193068 [15,] 123.8833 0.4187364 [16,] 123.8859 0.4185379 [17,] 123.8814 0.4179302 [18,] 123.8825 0.4177971 [19,] 123.8832 0.4172132 [20,] 123.8881 0.4161358 [21,] 123.8967 0.4154490 [22,] 123.9083 0.4142485 [23,] 123.9130 0.4134837 [24,] 123.9091 0.4131884 [25,] 123.9086 0.4129597 [26,] 123.9075 0.4126913 [27,] 123.9031 0.4122209 [28,] 123.9043 0.4117728 [29,] 123.9114 0.4112742 [30,] 123.9132 0.4110675 [31,] 123.9126 0.4108694 [32,] 123.9113 0.4106276 [33,] 123.9113 0.4104562 [34,] 123.9113 0.4100156 [35,] 123.9020 0.4094854 [36,] 123.8983 0.4087218 [37,] 123.8915 0.4083396 [38,] 123.9101 0.4068643 [39,] 123.9252 0.4056386 [40,] 123.9301 0.4049053 [41,] 123.9301 0.4039800 [42,] 123.9335 0.4033314 [43,] 123.9335 0.4030101 [44,] 123.9317 0.4025827 [45,] 123.9409 0.4016398 [46,] 123.9409 0.4012989 [47,] 123.9476 0.4006256 [48,] 123.9525 0.4003046 [49,] 123.9555 0.3999881 [50,] 123.9616 0.3984889 [51,] 123.9554 0.3972807 [52,] 123.9532 0.3971657 [53,] 123.9522 0.3971071 [54,] 123.9610 0.3957563 [55,] 123.9554 0.3953218 [56,] 123.9576 0.3951752 [57,] 123.9588 0.3945532 [58,] 123.9635 0.3939729 [59,] 123.9755 0.3932072 [60,] 123.9804 0.3928968 [61,] 123.9879 0.3921343 [62,] 123.9904 0.3919749 [63,] 123.9891 0.3910086 [64,] 123.9891 0.3910086 [65,] 123.9852 0.3906426 [66,] 123.9878 0.3901613 [67,] 123.9919 0.3892719 [68,] 123.9933 0.3890250 [69,] 123.9933 0.3888625 [70,] 123.9976 0.3884306 [71,] 123.9990 0.3880066 [72,] 124.0210 0.3864722 [73,] 124.0225 0.3856978 [74,] 124.0316 0.3849680 [75,] 124.0178 0.3840678 [76,] 124.0194 0.3834431 [77,] 124.0162 0.3830998 [78,] 124.0146 0.3830166 [79,] 124.0018 0.3823437 [80,] 123.9806 0.3810595 [81,] 123.9789 0.3809743 [82,] 123.9840 0.3804776 [83,] 123.9890 0.3801665 [84,] 123.9856 0.3796038 [85,] 123.9856 0.3796038 [86,] 123.9803 0.3787415 [87,] 123.9786 0.3786505 [88,] 124.0055 0.3768090 [89,] 124.0036 0.3767159 [90,] 123.9981 0.3752030 [91,] 124.0056 0.3747534 [92,] 124.0018 0.3743529 [93,] 124.0075 0.3740089 [94,] 124.0171 0.3727908 [95,] 124.0190 0.3715987 [96,] 124.0229 0.3709295 [97,] 124.0249 0.3708108 [98,] 124.0209 0.3706081 [99,] 124.0229 0.3700402 [100,] 124.0127 0.3695244 [101,] 124.0148 0.3691734 [102,] 124.0065 0.3682951 [103,] 124.0023 0.3680838 [104,] 124.0002 0.3675101 [105,] 123.9980 0.3671670 [106,] 123.9959 0.3670586 [107,] 123.9980 0.3669280 [108,] 124.0002 0.3667961 [109,] 124.0025 0.3659303 [110,] 124.0025 0.3649454 [111,] 124.0092 0.3642920 [112,] 124.0298 0.3620686 [113,] 124.0252 0.3618386 [114,] 124.0182 0.3607297 [115,] 124.0159 0.3603573 [116,] 124.0348 0.3582053 [117,] 124.0276 0.3575908 [118,] 124.0204 0.3572334 [119,] 124.0204 0.3569698 [120,] 124.0106 0.3562209 [121,] 124.0106 0.3559532 [122,] 124.0156 0.3551196 [123,] 124.0181 0.3546997 [124,] 124.0307 0.3539535 [125,] 124.0409 0.3528011 [126,] 124.0717 0.3509890 [127,] 124.0769 0.3501261 [128,] 124.0821 0.3495386 [129,] 124.0821 0.3481207 [130,] 124.0821 0.3478351 [131,] 124.0981 0.3466108 [132,] 124.1035 0.3457175 [133,] 124.1062 0.3452678 [134,] 124.1089 0.3451085 [135,] 124.1062 0.3443814 [136,] 124.1006 0.3435135 [137,] 124.0951 0.3432394 [138,] 124.1175 0.3404206 [139,] 124.1090 0.3393974 [140,] 124.2117 0.3331459 [141,] 124.2232 0.3281970 [142,] 124.2116 0.3276310 [143,] 124.2116 0.3276310 [144,] 124.2204 0.3268133 [145,] 124.1732 0.3238851 [146,] 124.1880 0.3227148 [147,] 124.1641 0.3199711 [148,] 124.1852 0.3155763 [149,] 124.2095 0.3122675 [150,] 124.2308 0.3104028 [151,] 124.3046 0.3052333 [152,] 124.3604 0.2985128 [153,] 124.3884 0.2969327 [154,] 124.4198 0.2886306 [155,] 124.4703 0.2844967 [156,] 124.5116 0.2821983 [157,] 124.5276 0.2806479 [158,] 124.5437 0.2790895 [159,] 124.5469 0.2785749 [160,] 124.6577 0.2724672 [161,] 124.6577 0.2707747 [162,] 124.7237 0.2668245 [163,] 124.7104 0.2661815 > (tri <- trimean(x)) [,1] [,2] [1,] 123.8762 0.4222775 [2,] 123.8833 0.4214876 [3,] 123.8969 0.4206874 [4,] 123.8969 0.4198759 [5,] 123.9109 0.4191642 [6,] 123.9181 0.4184395 [7,] 123.9251 0.4177316 [8,] 123.9251 0.4170212 [9,] 123.9393 0.4163056 [10,] 123.9457 0.4156493 [11,] 123.9530 0.4150307 [12,] 123.9601 0.4144211 [13,] 123.9672 0.4138027 [14,] 123.9744 0.4131905 [15,] 123.9811 0.4126307 [16,] 123.9811 0.4120963 [17,] 123.9949 0.4115583 [18,] 124.0021 0.4110440 [19,] 124.0093 0.4105205 [20,] 124.0166 0.4100157 [21,] 124.0236 0.4095585 [22,] 124.0302 0.4091245 [23,] 124.0363 0.4087415 [24,] 124.0423 0.4083843 [25,] 124.0485 0.4080268 [26,] 124.0547 0.4076654 [27,] 124.0611 0.4073013 [28,] 124.0677 0.4069437 [29,] 124.0743 0.4065910 [30,] 124.0807 0.4062453 [31,] 124.0871 0.4058929 [32,] 124.0871 0.4055329 [33,] 124.1001 0.4051667 [34,] 124.1068 0.4047909 [35,] 124.1135 0.4044161 [36,] 124.1206 0.4040449 [37,] 124.1278 0.4036862 [38,] 124.1354 0.4033248 [39,] 124.1424 0.4030026 [40,] 124.1491 0.4027098 [41,] 124.1557 0.4024279 [42,] 124.1623 0.4021633 [43,] 124.1689 0.4019061 [44,] 124.1756 0.4016446 [45,] 124.1824 0.4013818 [46,] 124.1890 0.4011354 [47,] 124.1956 0.4008847 [48,] 124.2022 0.4006406 [49,] 124.2087 0.4003912 [50,] 124.2152 0.4001362 [51,] 124.2216 0.3999127 [52,] 124.2282 0.3997113 [53,] 124.2350 0.3994978 [54,] 124.2418 0.3992703 [55,] 124.2485 0.3990682 [56,] 124.2554 0.3988632 [57,] 124.2623 0.3986466 [58,] 124.2693 0.3984321 [59,] 124.2762 0.3982185 [60,] 124.2830 0.3980112 [61,] 124.2897 0.3977965 [62,] 124.2963 0.3975873 [63,] 124.3030 0.3973658 [64,] 124.3030 0.3971544 [65,] 124.3165 0.3969257 [66,] 124.3235 0.3966891 [67,] 124.3305 0.3964480 [68,] 124.3375 0.3962135 [69,] 124.3445 0.3959674 [70,] 124.3516 0.3957067 [71,] 124.3587 0.3954386 [72,] 124.3659 0.3951624 [73,] 124.3727 0.3949094 [74,] 124.3796 0.3946577 [75,] 124.3864 0.3944065 [76,] 124.3935 0.3941588 [77,] 124.4007 0.3939079 [78,] 124.4080 0.3936454 [79,] 124.4154 0.3933638 [80,] 124.4232 0.3930779 [81,] 124.4314 0.3928031 [82,] 124.4398 0.3925082 [83,] 124.4482 0.3922040 [84,] 124.4566 0.3918852 [85,] 124.4652 0.3915571 [86,] 124.4739 0.3912045 [87,] 124.4828 0.3908492 [88,] 124.4918 0.3904704 [89,] 124.5005 0.3901167 [90,] 124.5093 0.3897390 [91,] 124.5183 0.3893747 [92,] 124.5273 0.3889959 [93,] 124.5365 0.3885998 [94,] 124.5457 0.3881848 [95,] 124.5549 0.3877743 [96,] 124.5642 0.3873668 [97,] 124.5735 0.3869480 [98,] 124.5829 0.3865021 [99,] 124.5925 0.3860297 [100,] 124.6022 0.3855403 [101,] 124.6122 0.3850306 [102,] 124.6224 0.3844961 [103,] 124.6328 0.3839495 [104,] 124.6434 0.3833717 [105,] 124.6542 0.3827717 [106,] 124.6652 0.3821421 [107,] 124.6764 0.3814747 [108,] 124.6877 0.3807690 [109,] 124.6992 0.3800233 [110,] 124.7107 0.3792572 [111,] 124.7225 0.3784728 [112,] 124.7343 0.3776604 [113,] 124.7460 0.3768666 [114,] 124.7579 0.3760296 [115,] 124.7701 0.3751733 [116,] 124.7825 0.3742751 [117,] 124.7948 0.3733898 [118,] 124.8075 0.3724672 [119,] 124.8204 0.3714976 [120,] 124.8335 0.3704767 [121,] 124.8471 0.3694157 [122,] 124.8608 0.3682988 [123,] 124.8608 0.3671420 [124,] 124.8888 0.3659295 [125,] 124.9029 0.3646709 [126,] 124.9170 0.3633766 [127,] 124.9309 0.3620702 [128,] 124.9309 0.3607148 [129,] 124.9592 0.3592985 [130,] 124.9736 0.3578456 [131,] 124.9883 0.3563149 [132,] 125.0030 0.3547378 [133,] 125.0179 0.3530983 [134,] 125.0330 0.3513763 [135,] 125.0483 0.3495567 [136,] 125.0640 0.3476534 [137,] 125.0800 0.3456662 [138,] 125.0964 0.3435675 [139,] 125.1128 0.3414550 [140,] 125.1296 0.3392508 [141,] 125.1450 0.3371811 [142,] 125.1605 0.3351796 [143,] 125.1765 0.3330702 [144,] 125.1928 0.3308257 [145,] 125.2093 0.3284732 [146,] 125.2269 0.3260793 [147,] 125.2447 0.3235831 [148,] 125.2632 0.3210346 [149,] 125.2817 0.3185156 [150,] 125.3002 0.3159809 [151,] 125.3187 0.3133645 [152,] 125.3364 0.3108269 [153,] 125.3534 0.3084369 [154,] 125.3703 0.3059596 [155,] 125.3871 0.3037005 [156,] 125.4033 0.3014844 [157,] 125.4192 0.2992258 [158,] 125.4351 0.2968784 [159,] 125.4511 0.2944364 [160,] 125.4674 0.2918370 [161,] 125.4821 0.2893851 [162,] 125.4972 0.2868310 [163,] 125.5114 0.2843051 > (midr <- midrange(x)) [1] 122.14 > midm <- array(NA,dim=8) > for (j in 1:8) midm[j] <- midmean(x,j) > midm [1] 124.8293 124.8608 124.8608 124.8608 124.8747 124.8293 124.8608 124.8608 > postscript(file="/var/www/html/freestat/rcomp/tmp/1rasg1291668731.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/freestat/rcomp/tmp/2rasg1291668731.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/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/3tdjx1291668731.tab") > > try(system("convert tmp/1rasg1291668731.ps tmp/1rasg1291668731.png",intern=TRUE)) character(0) > try(system("convert tmp/2rasg1291668731.ps tmp/2rasg1291668731.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.420 0.580 3.507