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(10 + ,10 + ,13 + ,14 + ,12 + ,11 + ,8 + ,8 + ,10 + ,10 + ,12 + ,12 + ,12 + ,11 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,10 + ,12 + ,10 + ,11 + ,10 + ,10 + ,12 + ,10 + ,12 + ,7 + ,12 + ,18 + ,12 + ,11 + ,13 + ,10 + ,10 + ,10 + ,8 + ,12 + ,10 + ,10 + ,8 + ,14 + ,9 + ,8 + ,12 + ,15 + ,14 + ,1 + ,9 + ,7 + ,8 + ,12 + ,57 + ,12 + ,10 + ,10 + ,8 + ,8 + ,16 + ,14 + ,13 + ,10 + ,12 + ,9 + ,12 + ,11 + ,10 + ,8 + ,8 + ,9 + ,12 + ,8 + ,12 + ,10 + ,12 + ,9 + ,8 + ,12 + ,8 + ,12 + ,10 + ,12 + ,9 + ,28 + ,10 + ,12 + ,9 + ,14 + ,12 + ,12 + ,99 + ,13 + ,13 + ,14 + ,12 + ,12 + ,10 + ,11 + ,12 + ,14 + ,10 + ,12 + ,12 + ,6 + ,12 + ,10 + ,12 + ,12 + ,12 + ,9 + ,12 + ,12 + ,13 + ,8 + ,12 + ,10 + ,10 + ,10 + ,9 + ,12 + ,9 + ,10 + ,8 + ,12 + ,10 + ,8 + ,8 + ,9 + ,12 + ,12 + ,10 + ,10 + ,9 + ,11 + ,10 + ,9 + ,15 + ,10 + ,8 + ,10 + ,8 + ,9 + ,9 + ,6 + ,16 + ,12 + ,12 + ,12 + ,12 + ,10 + ,12 + ,8 + ,9 + ,12 + ,12 + ,8 + ,14 + ,10 + ,12 + ,8 + ,11 + ,10 + ,12 + ,12 + ,12 + ,12 + ,8 + ,10 + ,7 + ,10 + ,10 + ,12 + ,11 + ,9 + ,10 + ,12 + ,14 + ,13 + ,10 + ,11 + ,10 + ,10 + ,8 + ,10 + ,10 + ,10 + ,8 + ,8 + ,4 + ,14 + ,8 + ,12 + ,12 + ,10 + ,8 + ,12 + ,12 + ,10 + ,10 + ,12 + ,12 + ,9 + ,11 + ,14 + ,10 + ,8 + ,12 + ,8 + ,10 + ,11 + ,12 + ,10 + ,10 + ,12 + ,8 + ,9 + ,12 + ,8 + ,8 + ,10 + ,10 + ,10 + ,14 + ,10 + ,12 + ,12 + ,13 + ,9 + ,12 + ,12 + ,10 + ,12 + ,6 + ,8 + ,12 + ,10 + ,9 + ,11 + ,11 + ,9 + ,10 + ,15 + ,12 + ,7 + ,7 + ,10 + ,9 + ,10 + ,10 + ,9 + ,12 + ,10 + ,9 + ,12 + ,10 + ,7 + ,12 + ,10 + ,10 + ,12 + ,8 + ,12 + ,10 + ,10 + ,9 + ,8 + ,8 + ,12 + ,12 + ,10 + ,12 + ,10 + ,9 + ,10 + ,10 + ,8 + ,10 + ,12 + ,12 + ,16 + ,10 + ,9 + ,12 + ,12 + ,10 + ,7 + ,12 + ,10 + ,10 + ,6 + ,9 + ,6 + ,18 + ,13 + ,10 + ,12 + ,15 + ,12 + ,12 + ,9 + ,7 + ,12 + ,13 + ,14 + ,13 + ,12 + ,8 + ,8 + ,10 + ,10 + ,8 + ,12 + ,10 + ,12 + ,12 + ,12 + ,9 + ,12 + ,7 + ,12 + ,8 + ,8 + ,12 + ,14 + ,10 + ,5 + ,9 + ,8 + ,13 + ,10 + ,10 + ,14 + ,10 + ,99 + ,10 + ,12 + ,17 + ,14 + ,8 + ,14 + ,12 + ,12 + ,10 + ,10 + ,8 + ,12 + ,12 + ,12 + ,10 + ,12 + ,10 + ,10 + ,12 + ,12 + ,12 + ,12 + ,13 + ,12 + ,8 + ,10 + ,12 + ,8 + ,10 + ,10 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,14 + ,10 + ,12 + ,14 + ,12 + ,14 + ,12 + ,13 + ,8 + ,12 + ,14 + ,10 + ,10 + ,11 + ,16 + ,12 + ,10 + ,10 + ,99 + ,8 + ,11 + ,12 + ,12 + ,11 + ,10 + ,20 + ,9 + ,14 + ,12 + ,10 + ,12 + ,10 + ,12 + ,12 + ,8 + ,12 + ,12 + ,10 + ,99 + ,12 + ,2 + ,10 + ,10 + ,10 + ,12 + ,12 + ,12 + ,12 + ,88 + ,9 + ,12 + ,14 + ,8 + ,12 + ,10 + ,10 + ,10 + ,7 + ,8 + ,10 + ,1 + ,10 + ,10 + ,9 + ,15 + ,10 + ,12 + ,12 + ,12 + ,11 + ,12 + ,12 + ,14 + ,8 + ,12 + ,12 + ,10 + ,14 + ,8 + ,10 + ,12 + ,10 + ,10 + ,10 + ,12 + ,9 + ,12 + ,11 + ,8 + ,14 + ,12 + ,10 + ,12 + ,10 + ,8 + ,14 + ,12 + ,12 + ,12 + ,8 + ,12 + ,12 + ,10 + ,12 + ,12 + ,12 + ,9 + ,11 + ,10 + ,15 + ,10 + ,9 + ,9 + ,10 + ,7 + ,10 + ,9 + ,10 + ,10 + ,10 + ,15 + ,12 + ,12 + ,10 + ,12 + ,8 + ,12 + ,11 + ,8 + ,14 + ,8 + ,12 + ,10 + ,15 + ,9 + ,13 + ,12 + ,14 + ,12 + ,12 + ,17 + ,10 + ,13 + ,12 + ,12 + ,10 + ,12 + ,10 + ,12 + ,10 + ,10 + ,10 + ,1 + ,8 + ,12 + ,10 + ,10 + ,10 + ,12 + ,12 + ,11 + ,12 + ,8 + ,8 + ,12 + ,12 + ,10 + ,12 + ,9 + ,10 + ,12 + ,12 + ,12 + ,12 + ,10 + ,10 + ,9 + ,12 + ,10 + ,9 + ,12 + ,7 + ,14 + ,10 + ,10 + ,9 + ,10 + ,8 + ,10 + ,12 + ,12 + ,10 + ,9 + ,10 + ,9 + ,12 + ,10 + ,12 + ,10 + ,9 + ,7 + ,12 + ,11 + ,12 + ,9 + ,13 + ,12 + ,12 + ,7 + ,8 + ,12 + ,12 + ,12 + ,11 + ,12 + ,13 + ,10 + ,12 + ,10 + ,12 + ,12 + ,15 + ,12 + ,12 + ,13 + ,10 + ,10 + ,8 + ,11 + ,12 + ,12 + ,12 + ,12 + ,10 + ,10 + ,12 + ,15 + ,12 + ,10 + ,10 + ,7 + ,12 + ,10 + ,11 + ,10 + ,10 + ,10 + ,10 + ,11 + ,7 + ,15 + ,8 + ,10 + ,6 + ,8 + ,9 + ,8 + ,7 + ,10 + ,12 + ,14 + ,11 + ,8 + ,10 + ,8 + ,8 + ,14 + ,12 + ,15 + ,12 + ,12 + ,9 + ,12 + ,12 + ,9 + ,11 + ,15 + ,11 + ,12 + ,7 + ,15 + ,9 + ,10 + ,15 + ,15 + ,8 + ,11 + ,12 + ,10 + ,10 + ,12 + ,7 + ,12 + ,10 + ,11 + ,12 + ,10 + ,10 + ,8 + ,9 + ,8 + ,10 + ,10 + ,14 + ,10 + ,10 + ,12 + ,12 + ,7 + ,12 + ,10 + ,12 + ,9 + ,9 + ,13 + ,14 + ,10 + ,12 + ,12 + ,12 + ,12 + ,12 + ,10 + ,10 + ,8 + ,12 + ,8 + ,14 + ,10 + ,70 + ,12 + ,10 + ,8 + ,8 + ,11 + ,10 + ,8 + ,7 + ,8 + ,50 + ,9 + ,12 + ,12 + ,7 + ,10 + ,8 + ,10 + ,10 + ,10 + ,8 + ,12 + ,7 + ,13 + ,13 + ,8 + ,8 + ,11 + ,6 + ,12 + ,9 + ,12 + ,13 + ,13 + ,12 + ,12 + ,10 + ,8 + ,12 + ,10 + ,10 + ,15 + ,12 + ,10 + ,12 + ,8 + ,8 + ,12 + ,12 + ,10 + ,12 + ,9 + ,12 + ,12 + ,10 + ,9 + ,10 + ,10 + ,10 + ,12 + ,12 + ,12 + ,12 + ,8 + ,10 + ,12 + ,15 + ,10 + ,8 + ,15 + ,10 + ,9 + ,12 + ,99 + ,10 + ,10 + ,11 + ,11 + ,12 + ,12 + ,14 + ,12 + ,14 + ,9 + ,10 + ,12 + ,13 + ,10 + ,11 + ,10 + ,12 + ,12 + ,12 + ,13 + ,14 + ,9 + ,10 + ,10 + ,12 + ,12 + ,10 + ,99 + ,8 + ,99 + ,12 + ,99 + ,12 + ,10 + ,12 + ,10 + ,12 + ,12 + ,12 + ,10 + ,12 + ,12 + ,10 + ,10 + ,12 + ,99 + ,12 + ,12 + ,9 + ,99 + ,12 + ,12 + ,9 + ,12 + ,12 + ,12 + ,15 + ,12 + ,12 + ,12 + ,8 + ,8 + ,12 + ,8 + ,12 + ,12 + ,10 + ,10 + ,12 + ,99 + ,8 + ,8 + ,99 + ,10 + ,10 + ,5 + ,9 + ,9 + ,99 + ,9 + ,10 + ,12) > 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: 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!) > 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] 12.32555 > sqrtn <- sqrt(length(x)) > (armse <- sd(x) / sqrtn) [1] 0.3981922 > (armose <- arm / armse) [1] 30.95378 > (geo <- geomean(x)) [1] 10.91575 > (har <- harmean(x)) [1] 10.15565 > (qua <- quamean(x)) [1] 16.96007 > (win <- winmean(x)) [,1] [,2] [1,] 12.32555 0.39819221 [2,] 12.32555 0.39819221 [3,] 12.32905 0.39808099 [4,] 12.33839 0.39782522 [5,] 12.34422 0.39769085 [6,] 12.34422 0.39769085 [7,] 12.35239 0.39752650 [8,] 12.35239 0.39752650 [9,] 12.35239 0.39752650 [10,] 12.35239 0.39752650 [11,] 12.35239 0.39752650 [12,] 12.35239 0.39752650 [13,] 12.18553 0.35546925 [14,] 11.90782 0.28310371 [15,] 11.68028 0.22947601 [16,] 11.54959 0.19967415 [17,] 11.11319 0.10797099 [18,] 10.94516 0.08102798 [19,] 10.90082 0.07568854 [20,] 10.90082 0.07568854 [21,] 10.87631 0.07314530 [22,] 10.87631 0.07314530 [23,] 10.84947 0.07068776 [24,] 10.84947 0.07068776 [25,] 10.84947 0.07068776 [26,] 10.84947 0.07068776 [27,] 10.81797 0.06821490 [28,] 10.81797 0.06821490 [29,] 10.81797 0.06821490 [30,] 10.81797 0.06821490 [31,] 10.81797 0.06821490 [32,] 10.81797 0.06821490 [33,] 10.81797 0.06821490 [34,] 10.81797 0.06821490 [35,] 10.81797 0.06821490 [36,] 10.81797 0.06821490 [37,] 10.86114 0.06569931 [38,] 10.86114 0.06569931 [39,] 10.86114 0.06569931 [40,] 10.86114 0.06569931 [41,] 10.86114 0.06569931 [42,] 10.86114 0.06569931 [43,] 10.86114 0.06569931 [44,] 10.86114 0.06569931 [45,] 10.86114 0.06569931 [46,] 10.86114 0.06569931 [47,] 10.80630 0.06202108 [48,] 10.80630 0.06202108 [49,] 10.80630 0.06202108 [50,] 10.80630 0.06202108 [51,] 10.80630 0.06202108 [52,] 10.80630 0.06202108 [53,] 10.80630 0.06202108 [54,] 10.80630 0.06202108 [55,] 10.80630 0.06202108 [56,] 10.80630 0.06202108 [57,] 10.80630 0.06202108 [58,] 10.80630 0.06202108 [59,] 10.80630 0.06202108 [60,] 10.80630 0.06202108 [61,] 10.80630 0.06202108 [62,] 10.80630 0.06202108 [63,] 10.80630 0.06202108 [64,] 10.80630 0.06202108 [65,] 10.80630 0.06202108 [66,] 10.80630 0.06202108 [67,] 10.80630 0.06202108 [68,] 10.80630 0.06202108 [69,] 10.80630 0.06202108 [70,] 10.80630 0.06202108 [71,] 10.80630 0.06202108 [72,] 10.80630 0.06202108 [73,] 10.80630 0.06202108 [74,] 10.80630 0.06202108 [75,] 10.80630 0.06202108 [76,] 10.80630 0.06202108 [77,] 10.80630 0.06202108 [78,] 10.80630 0.06202108 [79,] 10.80630 0.06202108 [80,] 10.80630 0.06202108 [81,] 10.80630 0.06202108 [82,] 10.80630 0.06202108 [83,] 10.80630 0.06202108 [84,] 10.80630 0.06202108 [85,] 10.70712 0.05666476 [86,] 10.70712 0.05666476 [87,] 10.70712 0.05666476 [88,] 10.70712 0.05666476 [89,] 10.70712 0.05666476 [90,] 10.70712 0.05666476 [91,] 10.70712 0.05666476 [92,] 10.70712 0.05666476 [93,] 10.70712 0.05666476 [94,] 10.70712 0.05666476 [95,] 10.70712 0.05666476 [96,] 10.70712 0.05666476 [97,] 10.70712 0.05666476 [98,] 10.70712 0.05666476 [99,] 10.70712 0.05666476 [100,] 10.70712 0.05666476 [101,] 10.70712 0.05666476 [102,] 10.70712 0.05666476 [103,] 10.70712 0.05666476 [104,] 10.70712 0.05666476 [105,] 10.70712 0.05666476 [106,] 10.70712 0.05666476 [107,] 10.70712 0.05666476 [108,] 10.70712 0.05666476 [109,] 10.70712 0.05666476 [110,] 10.70712 0.05666476 [111,] 10.57760 0.05146585 [112,] 10.57760 0.05146585 [113,] 10.57760 0.05146585 [114,] 10.57760 0.05146585 [115,] 10.57760 0.05146585 [116,] 10.57760 0.05146585 [117,] 10.57760 0.05146585 [118,] 10.57760 0.05146585 [119,] 10.57760 0.05146585 [120,] 10.57760 0.05146585 [121,] 10.57760 0.05146585 [122,] 10.57760 0.05146585 [123,] 10.57760 0.05146585 [124,] 10.57760 0.05146585 [125,] 10.57760 0.05146585 [126,] 10.57760 0.05146585 [127,] 10.57760 0.05146585 [128,] 10.57760 0.05146585 [129,] 10.57760 0.05146585 [130,] 10.57760 0.05146585 [131,] 10.57760 0.05146585 [132,] 10.57760 0.05146585 [133,] 10.57760 0.05146585 [134,] 10.73396 0.04314132 [135,] 10.73396 0.04314132 [136,] 10.73396 0.04314132 [137,] 10.73396 0.04314132 [138,] 10.73396 0.04314132 [139,] 10.73396 0.04314132 [140,] 10.73396 0.04314132 [141,] 10.73396 0.04314132 [142,] 10.73396 0.04314132 [143,] 10.73396 0.04314132 [144,] 10.73396 0.04314132 [145,] 10.73396 0.04314132 [146,] 10.73396 0.04314132 [147,] 10.73396 0.04314132 [148,] 10.73396 0.04314132 [149,] 10.73396 0.04314132 [150,] 10.73396 0.04314132 [151,] 10.73396 0.04314132 [152,] 10.73396 0.04314132 [153,] 10.73396 0.04314132 [154,] 10.73396 0.04314132 [155,] 10.73396 0.04314132 [156,] 10.73396 0.04314132 [157,] 10.73396 0.04314132 [158,] 10.73396 0.04314132 [159,] 10.73396 0.04314132 [160,] 10.73396 0.04314132 [161,] 10.73396 0.04314132 [162,] 10.73396 0.04314132 [163,] 10.73396 0.04314132 [164,] 10.73396 0.04314132 [165,] 10.73396 0.04314132 [166,] 10.73396 0.04314132 [167,] 10.73396 0.04314132 [168,] 10.73396 0.04314132 [169,] 10.73396 0.04314132 [170,] 10.73396 0.04314132 [171,] 10.73396 0.04314132 [172,] 10.73396 0.04314132 [173,] 10.73396 0.04314132 [174,] 10.73396 0.04314132 [175,] 10.73396 0.04314132 [176,] 10.73396 0.04314132 [177,] 10.73396 0.04314132 [178,] 10.73396 0.04314132 [179,] 10.73396 0.04314132 [180,] 10.73396 0.04314132 [181,] 10.73396 0.04314132 [182,] 10.73396 0.04314132 [183,] 10.73396 0.04314132 [184,] 10.73396 0.04314132 [185,] 10.73396 0.04314132 [186,] 10.73396 0.04314132 [187,] 10.73396 0.04314132 [188,] 10.73396 0.04314132 [189,] 10.73396 0.04314132 [190,] 10.73396 0.04314132 [191,] 10.73396 0.04314132 [192,] 10.73396 0.04314132 [193,] 10.73396 0.04314132 [194,] 10.73396 0.04314132 [195,] 10.73396 0.04314132 [196,] 10.73396 0.04314132 [197,] 10.73396 0.04314132 [198,] 10.73396 0.04314132 [199,] 10.73396 0.04314132 [200,] 10.73396 0.04314132 [201,] 10.73396 0.04314132 [202,] 10.96966 0.03341725 [203,] 10.96966 0.03341725 [204,] 10.96966 0.03341725 [205,] 10.96966 0.03341725 [206,] 10.96966 0.03341725 [207,] 10.96966 0.03341725 [208,] 10.96966 0.03341725 [209,] 10.96966 0.03341725 [210,] 10.96966 0.03341725 [211,] 10.96966 0.03341725 [212,] 10.96966 0.03341725 [213,] 10.96966 0.03341725 [214,] 10.96966 0.03341725 [215,] 10.96966 0.03341725 [216,] 10.96966 0.03341725 [217,] 10.96966 0.03341725 [218,] 10.96966 0.03341725 [219,] 10.96966 0.03341725 [220,] 10.96966 0.03341725 [221,] 10.96966 0.03341725 [222,] 10.96966 0.03341725 [223,] 10.96966 0.03341725 [224,] 10.96966 0.03341725 [225,] 10.96966 0.03341725 [226,] 10.96966 0.03341725 [227,] 10.96966 0.03341725 [228,] 10.96966 0.03341725 [229,] 10.96966 0.03341725 [230,] 10.96966 0.03341725 [231,] 10.96966 0.03341725 [232,] 10.96966 0.03341725 [233,] 10.96966 0.03341725 [234,] 10.96966 0.03341725 [235,] 10.96966 0.03341725 [236,] 10.96966 0.03341725 [237,] 10.96966 0.03341725 [238,] 10.96966 0.03341725 [239,] 10.96966 0.03341725 [240,] 10.96966 0.03341725 [241,] 10.96966 0.03341725 [242,] 10.96966 0.03341725 [243,] 10.96966 0.03341725 [244,] 10.96966 0.03341725 [245,] 10.96966 0.03341725 [246,] 10.96966 0.03341725 [247,] 10.96966 0.03341725 [248,] 10.96966 0.03341725 [249,] 10.96966 0.03341725 [250,] 10.96966 0.03341725 [251,] 10.96966 0.03341725 [252,] 10.96966 0.03341725 [253,] 10.96966 0.03341725 [254,] 10.96966 0.03341725 [255,] 10.96966 0.03341725 [256,] 10.96966 0.03341725 [257,] 10.96966 0.03341725 [258,] 10.96966 0.03341725 [259,] 10.96966 0.03341725 [260,] 10.96966 0.03341725 [261,] 10.96966 0.03341725 [262,] 10.96966 0.03341725 [263,] 10.96966 0.03341725 [264,] 10.96966 0.03341725 [265,] 10.96966 0.03341725 [266,] 10.96966 0.03341725 [267,] 10.96966 0.03341725 [268,] 10.96966 0.03341725 [269,] 10.96966 0.03341725 [270,] 10.96966 0.03341725 [271,] 10.96966 0.03341725 [272,] 10.96966 0.03341725 [273,] 10.96966 0.03341725 [274,] 10.96966 0.03341725 [275,] 10.96966 0.03341725 [276,] 10.96966 0.03341725 [277,] 10.96966 0.03341725 [278,] 10.96966 0.03341725 [279,] 10.96966 0.03341725 [280,] 10.96966 0.03341725 [281,] 10.96966 0.03341725 [282,] 10.96966 0.03341725 [283,] 10.96966 0.03341725 [284,] 10.96966 0.03341725 [285,] 10.96966 0.03341725 > (tri <- trimean(x)) [,1] [,2] [1,] 12.32555 0.38578066 [2,] 12.23743 0.37280675 [3,] 12.05993 0.35920764 [4,] 12.05993 0.34494950 [5,] 11.87603 0.32997543 [6,] 11.78107 0.31413349 [7,] 11.68565 0.29724756 [8,] 11.68565 0.27915636 [9,] 11.49106 0.25957115 [10,] 11.39307 0.23812024 [11,] 11.29461 0.21424025 [12,] 11.19568 0.18699857 [13,] 11.09627 0.15462322 [14,] 11.00965 0.12393920 [15,] 11.00965 0.10154932 [16,] 10.94317 0.08494671 [17,] 10.84933 0.07046763 [18,] 10.83313 0.06731027 [19,] 10.82662 0.06637338 [20,] 10.82252 0.06578650 [21,] 10.81840 0.06518776 [22,] 10.81550 0.06473338 [23,] 10.81258 0.06427068 [24,] 10.81088 0.06393571 [25,] 10.80917 0.06359517 [26,] 10.80745 0.06324892 [27,] 10.80573 0.06289681 [28,] 10.80524 0.06265577 [29,] 10.80476 0.06241097 [30,] 10.80476 0.06216232 [31,] 10.80427 0.06190974 [32,] 10.80377 0.06165316 [33,] 10.80278 0.06139249 [34,] 10.80228 0.06112763 [35,] 10.80178 0.06085850 [36,] 10.80127 0.06058500 [37,] 10.80077 0.06030704 [38,] 10.79898 0.06011468 [39,] 10.79718 0.05991924 [40,] 10.79537 0.05972067 [41,] 10.79355 0.05951889 [42,] 10.79172 0.05931385 [43,] 10.78988 0.05910548 [44,] 10.78804 0.05889371 [45,] 10.78618 0.05867846 [46,] 10.78431 0.05845968 [47,] 10.78244 0.05823727 [48,] 10.78187 0.05812190 [49,] 10.78129 0.05800466 [50,] 10.78071 0.05788553 [51,] 10.78013 0.05776446 [52,] 10.77955 0.05764143 [53,] 10.77896 0.05751640 [54,] 10.77837 0.05738933 [55,] 10.77778 0.05726019 [56,] 10.77718 0.05712894 [57,] 10.77658 0.05699553 [58,] 10.77598 0.05685994 [59,] 10.77537 0.05672213 [60,] 10.77537 0.05658204 [61,] 10.77476 0.05643963 [62,] 10.77415 0.05629487 [63,] 10.77353 0.05614771 [64,] 10.77291 0.05599811 [65,] 10.77166 0.05584600 [66,] 10.77103 0.05569136 [67,] 10.77040 0.05553412 [68,] 10.76976 0.05537424 [69,] 10.76912 0.05521166 [70,] 10.76848 0.05504633 [71,] 10.76783 0.05487819 [72,] 10.76718 0.05470719 [73,] 10.76653 0.05453327 [74,] 10.76587 0.05435637 [75,] 10.76521 0.05417642 [76,] 10.76454 0.05399336 [77,] 10.76387 0.05380713 [78,] 10.76320 0.05361766 [79,] 10.76252 0.05342487 [80,] 10.76184 0.05322869 [81,] 10.76115 0.05302906 [82,] 10.76046 0.05282589 [83,] 10.75977 0.05261910 [84,] 10.75907 0.05240861 [85,] 10.75837 0.05219434 [86,] 10.75912 0.05208865 [87,] 10.75988 0.05198103 [88,] 10.76065 0.05187146 [89,] 10.76141 0.05175988 [90,] 10.76219 0.05164626 [91,] 10.76296 0.05153057 [92,] 10.76374 0.05141276 [93,] 10.76453 0.05129278 [94,] 10.76532 0.05117060 [95,] 10.76612 0.05104617 [96,] 10.76692 0.05091944 [97,] 10.76772 0.05079038 [98,] 10.76853 0.05065892 [99,] 10.76935 0.05052503 [100,] 10.77017 0.05038864 [101,] 10.77099 0.05024972 [102,] 10.77182 0.05010820 [103,] 10.77266 0.04996403 [104,] 10.77350 0.04981715 [105,] 10.77434 0.04966750 [106,] 10.77519 0.04951503 [107,] 10.77605 0.04935967 [108,] 10.77691 0.04920136 [109,] 10.77778 0.04904003 [110,] 10.77865 0.04887561 [111,] 10.77953 0.04870804 [112,] 10.78199 0.04862567 [113,] 10.78447 0.04854142 [114,] 10.78696 0.04845525 [115,] 10.78947 0.04836712 [116,] 10.79200 0.04827698 [117,] 10.79454 0.04818479 [118,] 10.79710 0.04809051 [119,] 10.79968 0.04799410 [120,] 10.79968 0.04789549 [121,] 10.80488 0.04779465 [122,] 10.80488 0.04769153 [123,] 10.81015 0.04758607 [124,] 10.81015 0.04747822 [125,] 10.81549 0.04736792 [126,] 10.81549 0.04725513 [127,] 10.82090 0.04713977 [128,] 10.82090 0.04702180 [129,] 10.82638 0.04690115 [130,] 10.82915 0.04677775 [131,] 10.83193 0.04665155 [132,] 10.83474 0.04652246 [133,] 10.83756 0.04639043 [134,] 10.84041 0.04625538 [135,] 10.84157 0.04626467 [136,] 10.84274 0.04627348 [137,] 10.84391 0.04628182 [138,] 10.84509 0.04628968 [139,] 10.84629 0.04629703 [140,] 10.84749 0.04630387 [141,] 10.84870 0.04631020 [142,] 10.84991 0.04631599 [143,] 10.85114 0.04632123 [144,] 10.85237 0.04632592 [145,] 10.85362 0.04633003 [146,] 10.85487 0.04633357 [147,] 10.85613 0.04633650 [148,] 10.85740 0.04633883 [149,] 10.85868 0.04634054 [150,] 10.85996 0.04634160 [151,] 10.86126 0.04634201 [152,] 10.86257 0.04634176 [153,] 10.86388 0.04634082 [154,] 10.86521 0.04633918 [155,] 10.86654 0.04633683 [156,] 10.86789 0.04633375 [157,] 10.86924 0.04632992 [158,] 10.87061 0.04632532 [159,] 10.87199 0.04631994 [160,] 10.87337 0.04631375 [161,] 10.87477 0.04630675 [162,] 10.87617 0.04629890 [163,] 10.87759 0.04629020 [164,] 10.87902 0.04628062 [165,] 10.88046 0.04627013 [166,] 10.88190 0.04625872 [167,] 10.88337 0.04624637 [168,] 10.88484 0.04623305 [169,] 10.88632 0.04621875 [170,] 10.88781 0.04620342 [171,] 10.88932 0.04618706 [172,] 10.89084 0.04616964 [173,] 10.89237 0.04615113 [174,] 10.89391 0.04613150 [175,] 10.89546 0.04611073 [176,] 10.89703 0.04608880 [177,] 10.89861 0.04606566 [178,] 10.90020 0.04604129 [179,] 10.90180 0.04601566 [180,] 10.90342 0.04598875 [181,] 10.90505 0.04596051 [182,] 10.90669 0.04593091 [183,] 10.90835 0.04589993 [184,] 10.91002 0.04586751 [185,] 10.91170 0.04583364 [186,] 10.91340 0.04579827 [187,] 10.91511 0.04576137 [188,] 10.91684 0.04572288 [189,] 10.91858 0.04568278 [190,] 10.92034 0.04564103 [191,] 10.92211 0.04559756 [192,] 10.92389 0.04555236 [193,] 10.92569 0.04550536 [194,] 10.92751 0.04545652 [195,] 10.92934 0.04540579 [196,] 10.93118 0.04535312 [197,] 10.93305 0.04529845 [198,] 10.93492 0.04524175 [199,] 10.93682 0.04518294 [200,] 10.93873 0.04512197 [201,] 10.94066 0.04505878 [202,] 10.94260 0.04499332 [203,] 10.94235 0.04508354 [204,] 10.94209 0.04517430 [205,] 10.94183 0.04526560 [206,] 10.94157 0.04535744 [207,] 10.94131 0.04544984 [208,] 10.94104 0.04554278 [209,] 10.94077 0.04563629 [210,] 10.94050 0.04573036 [211,] 10.94023 0.04582500 [212,] 10.93995 0.04592022 [213,] 10.93968 0.04601602 [214,] 10.93939 0.04611241 [215,] 10.93939 0.04620940 [216,] 10.93882 0.04630698 [217,] 10.93853 0.04640517 [218,] 10.93824 0.04650397 [219,] 10.93824 0.04660339 [220,] 10.93765 0.04670343 [221,] 10.93735 0.04680410 [222,] 10.93705 0.04690541 [223,] 10.93705 0.04700736 [224,] 10.93643 0.04710997 [225,] 10.93612 0.04721323 [226,] 10.93580 0.04731715 [227,] 10.93580 0.04742174 [228,] 10.93516 0.04752701 [229,] 10.93484 0.04763297 [230,] 10.93451 0.04773961 [231,] 10.93451 0.04784696 [232,] 10.93384 0.04795501 [233,] 10.93350 0.04806377 [234,] 10.93316 0.04817325 [235,] 10.93282 0.04828347 [236,] 10.93247 0.04839442 [237,] 10.93211 0.04850611 [238,] 10.93176 0.04861855 [239,] 10.93140 0.04873176 [240,] 10.93140 0.04884573 [241,] 10.93067 0.04896048 [242,] 10.93029 0.04907602 [243,] 10.92992 0.04919235 [244,] 10.92992 0.04930948 [245,] 10.92916 0.04942742 [246,] 10.92877 0.04954618 [247,] 10.92837 0.04966577 [248,] 10.92837 0.04978620 [249,] 10.92758 0.04990748 [250,] 10.92717 0.05002961 [251,] 10.92676 0.05015261 [252,] 10.92676 0.05027648 [253,] 10.92593 0.05040125 [254,] 10.92550 0.05052690 [255,] 10.92507 0.05065346 [256,] 10.92507 0.05078094 [257,] 10.92420 0.05090934 [258,] 10.92375 0.05103868 [259,] 10.92330 0.05116897 [260,] 10.92285 0.05130022 [261,] 10.92239 0.05143243 [262,] 10.92192 0.05156563 [263,] 10.92145 0.05169982 [264,] 10.92097 0.05183501 [265,] 10.92049 0.05197121 [266,] 10.92000 0.05210844 [267,] 10.91950 0.05224671 [268,] 10.91900 0.05238603 [269,] 10.91850 0.05252641 [270,] 10.91798 0.05266786 [271,] 10.91746 0.05281041 [272,] 10.91693 0.05295405 [273,] 10.91640 0.05309881 [274,] 10.91586 0.05324469 [275,] 10.91531 0.05339171 [276,] 10.91475 0.05353988 [277,] 10.91419 0.05368922 [278,] 10.91362 0.05383974 [279,] 10.91304 0.05399145 [280,] 10.91246 0.05414437 [281,] 10.91186 0.05429851 [282,] 10.91126 0.05445388 [283,] 10.91065 0.05461051 [284,] 10.91003 0.05476841 [285,] 10.90941 0.05492758 > (midr <- midrange(x)) [1] 50 > midm <- array(NA,dim=8) > for (j in 1:8) midm[j] <- midmean(x,j) > midm [1] 11.11949 11.11949 11.11949 11.11949 11.11949 11.11949 11.11949 11.11949 > postscript(file="/var/www/html/rcomp/tmp/1r0tm1250077828.ps",horizontal=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/22oyv1250077828.ps",horizontal=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/30rq81250077829.tab") > > system("convert tmp/1r0tm1250077828.ps tmp/1r0tm1250077828.png") > system("convert tmp/22oyv1250077828.ps tmp/22oyv1250077828.png") > > > proc.time() user system elapsed 8.333 0.479 8.611