R version 2.7.1 (2008-06-23) 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. 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(5 + ,5 + ,6 + ,6 + ,6 + ,6 + ,6 + ,6 + ,6 + ,7 + ,7 + ,7 + ,7 + ,7 + ,7 + ,7 + ,7 + ,7 + ,7 + ,7 + ,7 + ,7 + ,7 + ,7 + ,7 + ,7 + ,7 + ,7 + ,7 + ,7 + ,7 + ,7 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,8 + ,9 + ,9 + ,9 + ,9 + ,9 + ,9 + ,9 + ,9 + ,9 + ,9 + ,9 + ,9 + ,9 + ,9 + ,9 + ,9 + ,9 + ,9 + ,9 + ,9 + ,9 + ,9 + ,9 + ,9 + ,9 + ,9 + ,9 + ,9 + ,9 + ,9 + ,9 + ,9 + ,9 + ,9 + ,9 + ,9 + ,9 + ,9 + ,9 + ,9 + ,9 + ,9 + ,9 + ,9 + ,9 + ,9 + ,9 + ,9 + ,9 + ,9 + ,9 + ,9 + ,9 + ,9 + ,9 + ,9 + ,9 + ,9 + ,9 + ,9 + ,9 + ,9 + ,9 + ,9 + ,9 + ,9 + ,9 + ,9 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,10 + ,11 + ,11 + ,11 + ,11 + ,11 + ,11 + ,11 + ,11 + ,11 + ,11 + ,11 + ,11 + ,11 + ,11 + ,11 + ,11 + ,11 + ,11 + ,11 + ,11 + ,11 + ,11 + ,11 + ,11 + ,11 + ,11 + ,11 + ,11 + ,11 + ,11 + ,11 + ,11 + ,11 + ,11 + ,11 + ,11 + ,11 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,13 + ,13 + ,13 + ,13 + ,13 + ,13 + ,13 + ,13 + ,13 + ,13 + ,13 + ,13 + ,13 + ,13 + ,13 + ,13 + ,13 + ,13 + ,13 + ,13 + ,13 + ,13 + ,13 + ,13 + ,13 + ,13 + ,14 + ,14 + ,14 + ,14 + ,14 + ,14 + ,14 + ,14 + ,14 + ,14 + ,14 + ,14 + ,14 + ,14 + ,14 + ,14 + ,14 + ,14 + ,14 + ,14 + ,14 + ,14 + ,14 + ,14 + ,14 + ,14 + ,14 + ,14 + ,14 + ,14 + ,14 + ,14 + ,14 + ,14 + ,14 + ,14 + ,14 + ,14 + ,15 + ,15 + ,15 + ,15 + ,15 + ,15 + ,15 + ,15 + ,15 + ,15 + ,15 + ,15 + ,15 + ,15 + ,15 + ,15 + ,15 + ,15 + ,15 + ,15 + ,16 + ,16 + ,16 + ,16 + ,17 + ,17 + ,18 + ,18) > 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] 10.74580 > sqrtn <- sqrt(length(x)) > (armse <- sd(x) / sqrtn) [1] 0.06848215 > (armose <- arm / armse) [1] 156.9139 > (geo <- geomean(x)) [1] 10.55826 > (har <- harmean(x)) [1] 10.36266 > (qua <- quamean(x)) [1] 10.92607 > (win <- winmean(x)) [,1] [,2] [1,] 10.74580 0.06848215 [2,] 10.74580 0.06797582 [3,] 10.74580 0.06797582 [4,] 10.74101 0.06748646 [5,] 10.74101 0.06748646 [6,] 10.74101 0.06748646 [7,] 10.74101 0.06748646 [8,] 10.73141 0.06666865 [9,] 10.74221 0.06584022 [10,] 10.74221 0.06584022 [11,] 10.74221 0.06584022 [12,] 10.74221 0.06584022 [13,] 10.74221 0.06584022 [14,] 10.74221 0.06584022 [15,] 10.74221 0.06584022 [16,] 10.74221 0.06584022 [17,] 10.74221 0.06584022 [18,] 10.74221 0.06584022 [19,] 10.74221 0.06584022 [20,] 10.74221 0.06584022 [21,] 10.74221 0.06584022 [22,] 10.74221 0.06584022 [23,] 10.74221 0.06584022 [24,] 10.74221 0.06584022 [25,] 10.74221 0.06584022 [26,] 10.74221 0.06584022 [27,] 10.74221 0.06584022 [28,] 10.70863 0.06348759 [29,] 10.70863 0.06348759 [30,] 10.70863 0.06348759 [31,] 10.70863 0.06348759 [32,] 10.74700 0.06110088 [33,] 10.74700 0.06110088 [34,] 10.74700 0.06110088 [35,] 10.74700 0.06110088 [36,] 10.74700 0.06110088 [37,] 10.74700 0.06110088 [38,] 10.74700 0.06110088 [39,] 10.74700 0.06110088 [40,] 10.74700 0.06110088 [41,] 10.74700 0.06110088 [42,] 10.74700 0.06110088 [43,] 10.74700 0.06110088 [44,] 10.74700 0.06110088 [45,] 10.74700 0.06110088 [46,] 10.74700 0.06110088 [47,] 10.74700 0.06110088 [48,] 10.74700 0.06110088 [49,] 10.74700 0.06110088 [50,] 10.74700 0.06110088 [51,] 10.74700 0.06110088 [52,] 10.74700 0.06110088 [53,] 10.74700 0.06110088 [54,] 10.74700 0.06110088 [55,] 10.74700 0.06110088 [56,] 10.74700 0.06110088 [57,] 10.74700 0.06110088 [58,] 10.74700 0.06110088 [59,] 10.74700 0.06110088 [60,] 10.74700 0.06110088 [61,] 10.74700 0.06110088 [62,] 10.74700 0.06110088 [63,] 10.74700 0.06110088 [64,] 10.74700 0.06110088 [65,] 10.74700 0.06110088 [66,] 10.66787 0.05659256 [67,] 10.66787 0.05659256 [68,] 10.66787 0.05659256 [69,] 10.66787 0.05659256 [70,] 10.66787 0.05659256 [71,] 10.66787 0.05659256 [72,] 10.66787 0.05659256 [73,] 10.66787 0.05659256 [74,] 10.66787 0.05659256 [75,] 10.66787 0.05659256 [76,] 10.66787 0.05659256 [77,] 10.66787 0.05659256 [78,] 10.66787 0.05659256 [79,] 10.66787 0.05659256 [80,] 10.66787 0.05659256 [81,] 10.66787 0.05659256 [82,] 10.66787 0.05659256 [83,] 10.66787 0.05659256 [84,] 10.66787 0.05659256 [85,] 10.66787 0.05659256 [86,] 10.66787 0.05659256 [87,] 10.66787 0.05659256 [88,] 10.66787 0.05659256 [89,] 10.66787 0.05659256 [90,] 10.66787 0.05659256 [91,] 10.66787 0.05659256 [92,] 10.55755 0.05198905 [93,] 10.55755 0.05198905 [94,] 10.55755 0.05198905 [95,] 10.55755 0.05198905 [96,] 10.55755 0.05198905 [97,] 10.55755 0.05198905 [98,] 10.55755 0.05198905 [99,] 10.55755 0.05198905 [100,] 10.55755 0.05198905 [101,] 10.55755 0.05198905 [102,] 10.55755 0.05198905 [103,] 10.55755 0.05198905 [104,] 10.55755 0.05198905 [105,] 10.55755 0.05198905 [106,] 10.55755 0.05198905 [107,] 10.55755 0.05198905 [108,] 10.55755 0.05198905 [109,] 10.55755 0.05198905 [110,] 10.55755 0.05198905 [111,] 10.55755 0.05198905 [112,] 10.55755 0.05198905 [113,] 10.55755 0.05198905 [114,] 10.55755 0.05198905 [115,] 10.55755 0.05198905 [116,] 10.55755 0.05198905 [117,] 10.55755 0.05198905 [118,] 10.55755 0.05198905 [119,] 10.55755 0.05198905 [120,] 10.55755 0.05198905 [121,] 10.55755 0.05198905 [122,] 10.55755 0.05198905 [123,] 10.55755 0.05198905 [124,] 10.55755 0.05198905 [125,] 10.55755 0.05198905 [126,] 10.55755 0.05198905 [127,] 10.55755 0.05198905 [128,] 10.55755 0.05198905 [129,] 10.55755 0.05198905 [130,] 10.71343 0.04363087 [131,] 10.71343 0.04363087 [132,] 10.71343 0.04363087 [133,] 10.71343 0.04363087 [134,] 10.71343 0.04363087 [135,] 10.71343 0.04363087 [136,] 10.71343 0.04363087 [137,] 10.71343 0.04363087 [138,] 10.71343 0.04363087 [139,] 10.71343 0.04363087 [140,] 10.71343 0.04363087 [141,] 10.71343 0.04363087 [142,] 10.71343 0.04363087 [143,] 10.71343 0.04363087 [144,] 10.71343 0.04363087 [145,] 10.71343 0.04363087 [146,] 10.71343 0.04363087 [147,] 10.71343 0.04363087 [148,] 10.71343 0.04363087 [149,] 10.71343 0.04363087 [150,] 10.71343 0.04363087 [151,] 10.71343 0.04363087 [152,] 10.71343 0.04363087 [153,] 10.71343 0.04363087 [154,] 10.71343 0.04363087 [155,] 10.71343 0.04363087 [156,] 10.71343 0.04363087 [157,] 10.71343 0.04363087 [158,] 10.71343 0.04363087 [159,] 10.71343 0.04363087 [160,] 10.71343 0.04363087 [161,] 10.71343 0.04363087 [162,] 10.71343 0.04363087 [163,] 10.71343 0.04363087 [164,] 10.71343 0.04363087 [165,] 10.71343 0.04363087 [166,] 10.71343 0.04363087 [167,] 10.71343 0.04363087 [168,] 10.71343 0.04363087 [169,] 10.71343 0.04363087 [170,] 10.71343 0.04363087 [171,] 10.71343 0.04363087 [172,] 10.71343 0.04363087 [173,] 10.71343 0.04363087 [174,] 10.71343 0.04363087 [175,] 10.71343 0.04363087 [176,] 10.71343 0.04363087 [177,] 10.71343 0.04363087 [178,] 10.71343 0.04363087 [179,] 10.71343 0.04363087 [180,] 10.71343 0.04363087 [181,] 10.71343 0.04363087 [182,] 10.71343 0.04363087 [183,] 10.71343 0.04363087 [184,] 10.71343 0.04363087 [185,] 10.71343 0.04363087 [186,] 10.71343 0.04363087 [187,] 10.71343 0.04363087 [188,] 10.71343 0.04363087 [189,] 10.71343 0.04363087 [190,] 10.71343 0.04363087 [191,] 10.71343 0.04363087 [192,] 10.71343 0.04363087 [193,] 10.71343 0.04363087 [194,] 10.71343 0.04363087 [195,] 10.71343 0.04363087 [196,] 10.71343 0.04363087 [197,] 10.71343 0.04363087 [198,] 10.95084 0.03382780 [199,] 10.95084 0.03382780 [200,] 10.95084 0.03382780 [201,] 10.95084 0.03382780 [202,] 10.95084 0.03382780 [203,] 10.95084 0.03382780 [204,] 10.95084 0.03382780 [205,] 10.95084 0.03382780 [206,] 10.95084 0.03382780 [207,] 10.95084 0.03382780 [208,] 10.95084 0.03382780 [209,] 10.95084 0.03382780 [210,] 10.95084 0.03382780 [211,] 10.95084 0.03382780 [212,] 10.95084 0.03382780 [213,] 10.95084 0.03382780 [214,] 10.95084 0.03382780 [215,] 10.95084 0.03382780 [216,] 10.95084 0.03382780 [217,] 10.95084 0.03382780 [218,] 10.95084 0.03382780 [219,] 10.95084 0.03382780 [220,] 10.95084 0.03382780 [221,] 10.95084 0.03382780 [222,] 10.95084 0.03382780 [223,] 10.95084 0.03382780 [224,] 10.95084 0.03382780 [225,] 10.95084 0.03382780 [226,] 10.95084 0.03382780 [227,] 10.95084 0.03382780 [228,] 10.95084 0.03382780 [229,] 10.95084 0.03382780 [230,] 10.95084 0.03382780 [231,] 10.95084 0.03382780 [232,] 10.95084 0.03382780 [233,] 10.95084 0.03382780 [234,] 10.95084 0.03382780 [235,] 10.95084 0.03382780 [236,] 10.95084 0.03382780 [237,] 10.95084 0.03382780 [238,] 10.95084 0.03382780 [239,] 10.95084 0.03382780 [240,] 10.95084 0.03382780 [241,] 10.95084 0.03382780 [242,] 10.95084 0.03382780 [243,] 10.95084 0.03382780 [244,] 10.95084 0.03382780 [245,] 10.95084 0.03382780 [246,] 10.95084 0.03382780 [247,] 10.95084 0.03382780 [248,] 10.95084 0.03382780 [249,] 10.95084 0.03382780 [250,] 10.95084 0.03382780 [251,] 10.95084 0.03382780 [252,] 10.95084 0.03382780 [253,] 10.95084 0.03382780 [254,] 10.95084 0.03382780 [255,] 10.95084 0.03382780 [256,] 10.95084 0.03382780 [257,] 10.95084 0.03382780 [258,] 10.95084 0.03382780 [259,] 10.95084 0.03382780 [260,] 10.95084 0.03382780 [261,] 10.95084 0.03382780 [262,] 10.95084 0.03382780 [263,] 10.95084 0.03382780 [264,] 10.95084 0.03382780 [265,] 10.95084 0.03382780 [266,] 10.95084 0.03382780 [267,] 10.95084 0.03382780 [268,] 10.95084 0.03382780 [269,] 10.95084 0.03382780 [270,] 10.95084 0.03382780 [271,] 10.95084 0.03382780 [272,] 10.95084 0.03382780 [273,] 10.95084 0.03382780 [274,] 10.95084 0.03382780 [275,] 10.95084 0.03382780 [276,] 10.95084 0.03382780 [277,] 10.95084 0.03382780 [278,] 10.95084 0.03382780 > (tri <- trimean(x)) [,1] [,2] [1,] 10.74580 0.06773866 [2,] 10.74399 0.06697915 [3,] 10.74034 0.06646717 [4,] 10.74034 0.06594572 [5,] 10.73786 0.06554430 [6,] 10.73723 0.06513606 [7,] 10.73659 0.06472080 [8,] 10.73659 0.06429836 [9,] 10.73652 0.06398059 [10,] 10.73587 0.06375817 [11,] 10.73522 0.06353236 [12,] 10.73457 0.06330310 [13,] 10.73391 0.06307032 [14,] 10.73325 0.06283395 [15,] 10.73259 0.06259391 [16,] 10.73259 0.06235013 [17,] 10.73125 0.06210254 [18,] 10.73058 0.06185105 [19,] 10.72990 0.06159557 [20,] 10.72922 0.06133604 [21,] 10.72854 0.06107235 [22,] 10.72785 0.06080442 [23,] 10.72716 0.06053215 [24,] 10.72646 0.06025544 [25,] 10.72577 0.05997421 [26,] 10.72506 0.05968833 [27,] 10.72436 0.05939772 [28,] 10.72365 0.05910224 [29,] 10.72423 0.05890849 [30,] 10.72481 0.05871168 [31,] 10.72539 0.05851175 [32,] 10.72539 0.05830863 [33,] 10.72526 0.05819644 [34,] 10.72454 0.05808245 [35,] 10.72382 0.05796662 [36,] 10.72310 0.05784892 [37,] 10.72237 0.05772932 [38,] 10.72164 0.05760778 [39,] 10.72090 0.05748428 [40,] 10.72016 0.05735878 [41,] 10.71941 0.05723123 [42,] 10.71867 0.05710161 [43,] 10.71791 0.05696988 [44,] 10.71716 0.05683599 [45,] 10.71640 0.05669991 [46,] 10.71563 0.05656160 [47,] 10.71486 0.05642102 [48,] 10.71409 0.05627812 [49,] 10.71332 0.05613286 [50,] 10.71253 0.05598519 [51,] 10.71175 0.05583507 [52,] 10.71096 0.05568246 [53,] 10.71096 0.05552730 [54,] 10.70937 0.05536954 [55,] 10.70856 0.05520913 [56,] 10.70776 0.05504602 [57,] 10.70694 0.05488016 [58,] 10.70613 0.05471149 [59,] 10.70531 0.05453995 [60,] 10.70448 0.05436548 [61,] 10.70365 0.05418803 [62,] 10.70282 0.05400752 [63,] 10.70198 0.05382391 [64,] 10.70198 0.05363711 [65,] 10.70028 0.05344706 [66,] 10.69943 0.05325370 [67,] 10.70000 0.05316471 [68,] 10.70057 0.05307411 [69,] 10.70115 0.05298185 [70,] 10.70173 0.05288791 [71,] 10.70231 0.05279226 [72,] 10.70290 0.05269487 [73,] 10.70349 0.05259569 [74,] 10.70408 0.05249471 [75,] 10.70468 0.05239189 [76,] 10.70528 0.05228718 [77,] 10.70588 0.05218057 [78,] 10.70649 0.05207200 [79,] 10.70710 0.05196144 [80,] 10.70772 0.05184885 [81,] 10.70833 0.05173420 [82,] 10.70896 0.05161744 [83,] 10.70958 0.05149854 [84,] 10.71021 0.05137744 [85,] 10.71084 0.05125410 [86,] 10.71148 0.05112849 [87,] 10.71212 0.05100054 [88,] 10.71277 0.05087023 [89,] 10.71341 0.05073748 [90,] 10.71407 0.05060227 [91,] 10.71472 0.05046453 [92,] 10.71538 0.05032421 [93,] 10.71759 0.05026594 [94,] 10.71981 0.05020625 [95,] 10.72205 0.05014509 [96,] 10.72430 0.05008245 [97,] 10.72656 0.05001830 [98,] 10.72884 0.04995259 [99,] 10.73113 0.04988531 [100,] 10.73344 0.04981642 [101,] 10.73576 0.04974588 [102,] 10.73810 0.04967367 [103,] 10.74045 0.04959974 [104,] 10.74281 0.04952406 [105,] 10.74519 0.04944660 [106,] 10.74519 0.04936731 [107,] 10.75000 0.04928617 [108,] 10.75243 0.04920311 [109,] 10.75487 0.04911812 [110,] 10.75733 0.04903114 [111,] 10.75980 0.04894213 [112,] 10.76230 0.04885104 [113,] 10.76230 0.04875784 [114,] 10.76733 0.04866247 [115,] 10.76987 0.04856489 [116,] 10.77243 0.04846504 [117,] 10.77243 0.04836288 [118,] 10.77759 0.04825834 [119,] 10.78020 0.04815139 [120,] 10.78283 0.04804195 [121,] 10.78283 0.04792998 [122,] 10.78814 0.04781542 [123,] 10.79082 0.04769819 [124,] 10.79352 0.04757824 [125,] 10.79623 0.04745551 [126,] 10.79897 0.04732993 [127,] 10.80172 0.04720142 [128,] 10.80172 0.04706992 [129,] 10.80729 0.04693535 [130,] 10.81010 0.04679763 [131,] 10.81119 0.04680817 [132,] 10.81228 0.04681823 [133,] 10.81338 0.04682780 [134,] 10.81449 0.04683688 [135,] 10.81560 0.04684545 [136,] 10.81673 0.04685349 [137,] 10.81786 0.04686101 [138,] 10.81900 0.04686797 [139,] 10.82014 0.04687438 [140,] 10.82130 0.04688022 [141,] 10.82246 0.04688547 [142,] 10.82364 0.04689013 [143,] 10.82482 0.04689417 [144,] 10.82601 0.04689759 [145,] 10.82721 0.04690037 [146,] 10.82841 0.04690249 [147,] 10.82963 0.04690394 [148,] 10.83086 0.04690470 [149,] 10.83209 0.04690475 [150,] 10.83333 0.04690409 [151,] 10.83459 0.04690269 [152,] 10.83585 0.04690054 [153,] 10.83712 0.04689761 [154,] 10.83840 0.04689390 [155,] 10.83969 0.04688937 [156,] 10.84100 0.04688402 [157,] 10.84231 0.04687781 [158,] 10.84363 0.04687074 [159,] 10.84496 0.04686278 [160,] 10.84630 0.04685390 [161,] 10.84766 0.04684409 [162,] 10.84902 0.04683333 [163,] 10.85039 0.04682158 [164,] 10.85178 0.04680884 [165,] 10.85317 0.04679506 [166,] 10.85458 0.04678023 [167,] 10.85600 0.04676432 [168,] 10.85743 0.04674731 [169,] 10.85887 0.04672916 [170,] 10.86032 0.04670985 [171,] 10.86179 0.04668935 [172,] 10.86327 0.04666763 [173,] 10.86475 0.04664465 [174,] 10.86626 0.04662040 [175,] 10.86777 0.04659483 [176,] 10.86929 0.04656791 [177,] 10.87083 0.04653960 [178,] 10.87238 0.04650988 [179,] 10.87395 0.04647870 [180,] 10.87553 0.04644603 [181,] 10.87712 0.04641183 [182,] 10.87872 0.04637605 [183,] 10.88034 0.04633866 [184,] 10.88197 0.04629962 [185,] 10.88362 0.04625888 [186,] 10.88528 0.04621639 [187,] 10.88696 0.04617211 [188,] 10.88865 0.04612599 [189,] 10.89035 0.04607799 [190,] 10.89207 0.04602804 [191,] 10.89381 0.04597610 [192,] 10.89556 0.04592211 [193,] 10.89732 0.04586601 [194,] 10.89910 0.04580776 [195,] 10.90090 0.04574728 [196,] 10.90271 0.04568451 [197,] 10.90455 0.04561939 [198,] 10.90639 0.04555186 [199,] 10.90596 0.04564467 [200,] 10.90553 0.04573803 [201,] 10.90509 0.04583194 [202,] 10.90465 0.04592642 [203,] 10.90421 0.04602145 [204,] 10.90376 0.04611705 [205,] 10.90330 0.04621323 [206,] 10.90284 0.04630999 [207,] 10.90238 0.04640733 [208,] 10.90191 0.04650526 [209,] 10.90144 0.04660379 [210,] 10.90097 0.04670292 [211,] 10.90097 0.04680266 [212,] 10.90049 0.04690301 [213,] 10.89951 0.04700398 [214,] 10.89901 0.04710558 [215,] 10.89851 0.04720781 [216,] 10.89801 0.04731067 [217,] 10.89750 0.04741418 [218,] 10.89698 0.04751834 [219,] 10.89698 0.04762315 [220,] 10.89594 0.04772863 [221,] 10.89541 0.04783478 [222,] 10.89487 0.04794160 [223,] 10.89433 0.04804910 [224,] 10.89378 0.04815729 [225,] 10.89323 0.04826617 [226,] 10.89323 0.04837576 [227,] 10.89267 0.04848606 [228,] 10.89153 0.04859707 [229,] 10.89096 0.04870881 [230,] 10.89037 0.04882127 [231,] 10.88978 0.04893448 [232,] 10.88919 0.04904842 [233,] 10.88859 0.04916312 [234,] 10.88859 0.04927858 [235,] 10.88736 0.04939481 [236,] 10.88674 0.04951181 [237,] 10.88611 0.04962959 [238,] 10.88547 0.04974816 [239,] 10.88483 0.04986753 [240,] 10.88418 0.04998771 [241,] 10.88418 0.05010870 [242,] 10.88352 0.05023051 [243,] 10.88218 0.05035315 [244,] 10.88150 0.05047663 [245,] 10.88081 0.05060095 [246,] 10.88012 0.05072613 [247,] 10.87941 0.05085218 [248,] 10.87870 0.05097909 [249,] 10.87870 0.05110689 [250,] 10.87725 0.05123557 [251,] 10.87651 0.05136515 [252,] 10.87576 0.05149564 [253,] 10.87500 0.05162705 [254,] 10.87423 0.05175938 [255,] 10.87346 0.05189264 [256,] 10.87346 0.05202685 [257,] 10.87187 0.05216200 [258,] 10.87107 0.05229812 [259,] 10.87025 0.05243521 [260,] 10.86943 0.05257328 [261,] 10.86859 0.05271234 [262,] 10.86774 0.05285239 [263,] 10.86688 0.05299345 [264,] 10.86601 0.05313554 [265,] 10.86513 0.05327864 [266,] 10.86424 0.05342279 [267,] 10.86333 0.05356798 [268,] 10.86242 0.05371422 [269,] 10.86149 0.05386153 [270,] 10.86054 0.05400991 [271,] 10.85959 0.05415938 [272,] 10.85862 0.05430994 [273,] 10.85764 0.05446161 [274,] 10.85664 0.05461438 [275,] 10.85563 0.05476828 [276,] 10.85461 0.05492331 [277,] 10.85357 0.05507947 [278,] 10.85252 0.05523679 > (midr <- midrange(x)) [1] 11.5 > 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/167xi1218458258.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/2asls1218458258.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/3wx4n1218458259.tab") > > system("convert tmp/167xi1218458258.ps tmp/167xi1218458258.png") > system("convert tmp/2asls1218458258.ps tmp/2asls1218458258.png") > > > proc.time() user system elapsed 9.731 0.440 9.941