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(4 + ,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 + ,20 + ,28) > 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.76941 > sqrtn <- sqrt(length(x)) > (armse <- sd(x) / sqrtn) [1] 0.07258403 > (armose <- arm / armse) [1] 148.3717 > (geo <- geomean(x)) [1] 10.56638 > (har <- harmean(x)) [1] 10.35673 > (qua <- quamean(x)) [1] 10.97200 > (win <- winmean(x)) [,1] [,2] [1,] 10.76105 0.07034137 [2,] 10.75627 0.06966840 [3,] 10.75986 0.06934407 [4,] 10.75508 0.06878599 [5,] 10.75508 0.06878599 [6,] 10.74791 0.06806562 [7,] 10.74791 0.06806562 [8,] 10.74791 0.06806562 [9,] 10.74791 0.06806562 [10,] 10.74791 0.06614898 [11,] 10.74791 0.06614898 [12,] 10.74791 0.06614898 [13,] 10.74791 0.06614898 [14,] 10.74791 0.06614898 [15,] 10.74791 0.06614898 [16,] 10.74791 0.06614898 [17,] 10.74791 0.06614898 [18,] 10.74791 0.06614898 [19,] 10.74791 0.06614898 [20,] 10.74791 0.06614898 [21,] 10.74791 0.06614898 [22,] 10.74791 0.06614898 [23,] 10.74791 0.06614898 [24,] 10.74791 0.06614898 [25,] 10.74791 0.06614898 [26,] 10.74791 0.06614898 [27,] 10.74791 0.06614898 [28,] 10.74791 0.06614898 [29,] 10.74791 0.06614898 [30,] 10.71207 0.06365862 [31,] 10.71207 0.06365862 [32,] 10.71207 0.06365862 [33,] 10.75149 0.06121759 [34,] 10.75149 0.06121759 [35,] 10.75149 0.06121759 [36,] 10.75149 0.06121759 [37,] 10.75149 0.06121759 [38,] 10.75149 0.06121759 [39,] 10.75149 0.06121759 [40,] 10.75149 0.06121759 [41,] 10.75149 0.06121759 [42,] 10.75149 0.06121759 [43,] 10.75149 0.06121759 [44,] 10.75149 0.06121759 [45,] 10.75149 0.06121759 [46,] 10.75149 0.06121759 [47,] 10.75149 0.06121759 [48,] 10.75149 0.06121759 [49,] 10.75149 0.06121759 [50,] 10.75149 0.06121759 [51,] 10.75149 0.06121759 [52,] 10.75149 0.06121759 [53,] 10.75149 0.06121759 [54,] 10.75149 0.06121759 [55,] 10.75149 0.06121759 [56,] 10.75149 0.06121759 [57,] 10.75149 0.06121759 [58,] 10.75149 0.06121759 [59,] 10.75149 0.06121759 [60,] 10.75149 0.06121759 [61,] 10.75149 0.06121759 [62,] 10.75149 0.06121759 [63,] 10.75149 0.06121759 [64,] 10.75149 0.06121759 [65,] 10.75149 0.06121759 [66,] 10.75149 0.06121759 [67,] 10.75149 0.06121759 [68,] 10.67025 0.05661711 [69,] 10.67025 0.05661711 [70,] 10.67025 0.05661711 [71,] 10.67025 0.05661711 [72,] 10.67025 0.05661711 [73,] 10.67025 0.05661711 [74,] 10.67025 0.05661711 [75,] 10.67025 0.05661711 [76,] 10.67025 0.05661711 [77,] 10.67025 0.05661711 [78,] 10.67025 0.05661711 [79,] 10.67025 0.05661711 [80,] 10.67025 0.05661711 [81,] 10.67025 0.05661711 [82,] 10.67025 0.05661711 [83,] 10.67025 0.05661711 [84,] 10.67025 0.05661711 [85,] 10.67025 0.05661711 [86,] 10.67025 0.05661711 [87,] 10.67025 0.05661711 [88,] 10.67025 0.05661711 [89,] 10.67025 0.05661711 [90,] 10.67025 0.05661711 [91,] 10.67025 0.05661711 [92,] 10.67025 0.05661711 [93,] 10.67025 0.05661711 [94,] 10.55795 0.05195002 [95,] 10.55795 0.05195002 [96,] 10.55795 0.05195002 [97,] 10.55795 0.05195002 [98,] 10.55795 0.05195002 [99,] 10.55795 0.05195002 [100,] 10.55795 0.05195002 [101,] 10.55795 0.05195002 [102,] 10.55795 0.05195002 [103,] 10.55795 0.05195002 [104,] 10.55795 0.05195002 [105,] 10.55795 0.05195002 [106,] 10.55795 0.05195002 [107,] 10.55795 0.05195002 [108,] 10.55795 0.05195002 [109,] 10.55795 0.05195002 [110,] 10.55795 0.05195002 [111,] 10.55795 0.05195002 [112,] 10.55795 0.05195002 [113,] 10.55795 0.05195002 [114,] 10.55795 0.05195002 [115,] 10.55795 0.05195002 [116,] 10.55795 0.05195002 [117,] 10.55795 0.05195002 [118,] 10.55795 0.05195002 [119,] 10.55795 0.05195002 [120,] 10.55795 0.05195002 [121,] 10.55795 0.05195002 [122,] 10.55795 0.05195002 [123,] 10.55795 0.05195002 [124,] 10.55795 0.05195002 [125,] 10.55795 0.05195002 [126,] 10.55795 0.05195002 [127,] 10.55795 0.05195002 [128,] 10.55795 0.05195002 [129,] 10.55795 0.05195002 [130,] 10.55795 0.05195002 [131,] 10.71446 0.04357693 [132,] 10.71446 0.04357693 [133,] 10.71446 0.04357693 [134,] 10.71446 0.04357693 [135,] 10.71446 0.04357693 [136,] 10.71446 0.04357693 [137,] 10.71446 0.04357693 [138,] 10.71446 0.04357693 [139,] 10.71446 0.04357693 [140,] 10.71446 0.04357693 [141,] 10.71446 0.04357693 [142,] 10.71446 0.04357693 [143,] 10.71446 0.04357693 [144,] 10.71446 0.04357693 [145,] 10.71446 0.04357693 [146,] 10.71446 0.04357693 [147,] 10.71446 0.04357693 [148,] 10.71446 0.04357693 [149,] 10.71446 0.04357693 [150,] 10.71446 0.04357693 [151,] 10.71446 0.04357693 [152,] 10.71446 0.04357693 [153,] 10.71446 0.04357693 [154,] 10.71446 0.04357693 [155,] 10.71446 0.04357693 [156,] 10.71446 0.04357693 [157,] 10.71446 0.04357693 [158,] 10.71446 0.04357693 [159,] 10.71446 0.04357693 [160,] 10.71446 0.04357693 [161,] 10.71446 0.04357693 [162,] 10.71446 0.04357693 [163,] 10.71446 0.04357693 [164,] 10.71446 0.04357693 [165,] 10.71446 0.04357693 [166,] 10.71446 0.04357693 [167,] 10.71446 0.04357693 [168,] 10.71446 0.04357693 [169,] 10.71446 0.04357693 [170,] 10.71446 0.04357693 [171,] 10.71446 0.04357693 [172,] 10.71446 0.04357693 [173,] 10.71446 0.04357693 [174,] 10.71446 0.04357693 [175,] 10.71446 0.04357693 [176,] 10.71446 0.04357693 [177,] 10.71446 0.04357693 [178,] 10.71446 0.04357693 [179,] 10.71446 0.04357693 [180,] 10.71446 0.04357693 [181,] 10.71446 0.04357693 [182,] 10.71446 0.04357693 [183,] 10.71446 0.04357693 [184,] 10.71446 0.04357693 [185,] 10.71446 0.04357693 [186,] 10.71446 0.04357693 [187,] 10.71446 0.04357693 [188,] 10.71446 0.04357693 [189,] 10.71446 0.04357693 [190,] 10.71446 0.04357693 [191,] 10.71446 0.04357693 [192,] 10.71446 0.04357693 [193,] 10.71446 0.04357693 [194,] 10.71446 0.04357693 [195,] 10.71446 0.04357693 [196,] 10.71446 0.04357693 [197,] 10.71446 0.04357693 [198,] 10.71446 0.04357693 [199,] 10.95221 0.03377222 [200,] 10.95221 0.03377222 [201,] 10.95221 0.03377222 [202,] 10.95221 0.03377222 [203,] 10.95221 0.03377222 [204,] 10.95221 0.03377222 [205,] 10.95221 0.03377222 [206,] 10.95221 0.03377222 [207,] 10.95221 0.03377222 [208,] 10.95221 0.03377222 [209,] 10.95221 0.03377222 [210,] 10.95221 0.03377222 [211,] 10.95221 0.03377222 [212,] 10.95221 0.03377222 [213,] 10.95221 0.03377222 [214,] 10.95221 0.03377222 [215,] 10.95221 0.03377222 [216,] 10.95221 0.03377222 [217,] 10.95221 0.03377222 [218,] 10.95221 0.03377222 [219,] 10.95221 0.03377222 [220,] 10.95221 0.03377222 [221,] 10.95221 0.03377222 [222,] 10.95221 0.03377222 [223,] 10.95221 0.03377222 [224,] 10.95221 0.03377222 [225,] 10.95221 0.03377222 [226,] 10.95221 0.03377222 [227,] 10.95221 0.03377222 [228,] 10.95221 0.03377222 [229,] 10.95221 0.03377222 [230,] 10.95221 0.03377222 [231,] 10.95221 0.03377222 [232,] 10.95221 0.03377222 [233,] 10.95221 0.03377222 [234,] 10.95221 0.03377222 [235,] 10.95221 0.03377222 [236,] 10.95221 0.03377222 [237,] 10.95221 0.03377222 [238,] 10.95221 0.03377222 [239,] 10.95221 0.03377222 [240,] 10.95221 0.03377222 [241,] 10.95221 0.03377222 [242,] 10.95221 0.03377222 [243,] 10.95221 0.03377222 [244,] 10.95221 0.03377222 [245,] 10.95221 0.03377222 [246,] 10.95221 0.03377222 [247,] 10.95221 0.03377222 [248,] 10.95221 0.03377222 [249,] 10.95221 0.03377222 [250,] 10.95221 0.03377222 [251,] 10.95221 0.03377222 [252,] 10.95221 0.03377222 [253,] 10.95221 0.03377222 [254,] 10.95221 0.03377222 [255,] 10.95221 0.03377222 [256,] 10.95221 0.03377222 [257,] 10.95221 0.03377222 [258,] 10.95221 0.03377222 [259,] 10.95221 0.03377222 [260,] 10.95221 0.03377222 [261,] 10.95221 0.03377222 [262,] 10.95221 0.03377222 [263,] 10.95221 0.03377222 [264,] 10.95221 0.03377222 [265,] 10.95221 0.03377222 [266,] 10.95221 0.03377222 [267,] 10.95221 0.03377222 [268,] 10.95221 0.03377222 [269,] 10.95221 0.03377222 [270,] 10.95221 0.03377222 [271,] 10.95221 0.03377222 [272,] 10.95221 0.03377222 [273,] 10.95221 0.03377222 [274,] 10.95221 0.03377222 [275,] 10.95221 0.03377222 [276,] 10.95221 0.03377222 [277,] 10.95221 0.03377222 [278,] 10.95221 0.03377222 [279,] 10.95221 0.03377222 > (tri <- trimean(x)) [,1] [,2] [1,] 10.76941 0.06929215 [2,] 10.75689 0.06821572 [3,] 10.75090 0.06746621 [4,] 10.75090 0.06681498 [5,] 10.74607 0.06629967 [6,] 10.74424 0.06577480 [7,] 10.74362 0.06537038 [8,] 10.74362 0.06495906 [9,] 10.74237 0.06454064 [10,] 10.74174 0.06411495 [11,] 10.74110 0.06389446 [12,] 10.74047 0.06367063 [13,] 10.73983 0.06344338 [14,] 10.73918 0.06321265 [15,] 10.73854 0.06297836 [16,] 10.73854 0.06274046 [17,] 10.73724 0.06249886 [18,] 10.73658 0.06225349 [19,] 10.73592 0.06200426 [20,] 10.73526 0.06175111 [21,] 10.73459 0.06149393 [22,] 10.73392 0.06123266 [23,] 10.73325 0.06096720 [24,] 10.73257 0.06069745 [25,] 10.73189 0.06042333 [26,] 10.73121 0.06014473 [27,] 10.73052 0.05986155 [28,] 10.72983 0.05957369 [29,] 10.72914 0.05928104 [30,] 10.72844 0.05898349 [31,] 10.72903 0.05878797 [32,] 10.72903 0.05858935 [33,] 10.73022 0.05838758 [34,] 10.72952 0.05827651 [35,] 10.72881 0.05816365 [36,] 10.72810 0.05804898 [37,] 10.72739 0.05793246 [38,] 10.72668 0.05781406 [39,] 10.72596 0.05769375 [40,] 10.72523 0.05757149 [41,] 10.72450 0.05744724 [42,] 10.72377 0.05732098 [43,] 10.72304 0.05719267 [44,] 10.72230 0.05706226 [45,] 10.72155 0.05692973 [46,] 10.72081 0.05679503 [47,] 10.72005 0.05665813 [48,] 10.71930 0.05651897 [49,] 10.71854 0.05637753 [50,] 10.71777 0.05623375 [51,] 10.71701 0.05608759 [52,] 10.71623 0.05593902 [53,] 10.71546 0.05578797 [54,] 10.71468 0.05563441 [55,] 10.71389 0.05547828 [56,] 10.71310 0.05531953 [57,] 10.71231 0.05515812 [58,] 10.71151 0.05499398 [59,] 10.71071 0.05482707 [60,] 10.70990 0.05465733 [61,] 10.70909 0.05448470 [62,] 10.70827 0.05430911 [63,] 10.70745 0.05413052 [64,] 10.70745 0.05394885 [65,] 10.70580 0.05376405 [66,] 10.70496 0.05357603 [67,] 10.70413 0.05338474 [68,] 10.70328 0.05319011 [69,] 10.70386 0.05310012 [70,] 10.70445 0.05300849 [71,] 10.70504 0.05291519 [72,] 10.70563 0.05282019 [73,] 10.70622 0.05272346 [74,] 10.70682 0.05262496 [75,] 10.70742 0.05252467 [76,] 10.70803 0.05242255 [77,] 10.70864 0.05231856 [78,] 10.70925 0.05221267 [79,] 10.70987 0.05210485 [80,] 10.71049 0.05199505 [81,] 10.71111 0.05188324 [82,] 10.71174 0.05176938 [83,] 10.71237 0.05165343 [84,] 10.71300 0.05153535 [85,] 10.71364 0.05141509 [86,] 10.71429 0.05129261 [87,] 10.71493 0.05116787 [88,] 10.71558 0.05104082 [89,] 10.71624 0.05091142 [90,] 10.71689 0.05077961 [91,] 10.71756 0.05064535 [92,] 10.71822 0.05050858 [93,] 10.71889 0.05036925 [94,] 10.71957 0.05022731 [95,] 10.72179 0.05016762 [96,] 10.72403 0.05010648 [97,] 10.72628 0.05004385 [98,] 10.72855 0.04997970 [99,] 10.73083 0.04991402 [100,] 10.73312 0.04984676 [101,] 10.73543 0.04977789 [102,] 10.73776 0.04970737 [103,] 10.74010 0.04963519 [104,] 10.74245 0.04956129 [105,] 10.74245 0.04948565 [106,] 10.74720 0.04940823 [107,] 10.74960 0.04932899 [108,] 10.75201 0.04924789 [109,] 10.75201 0.04916489 [110,] 10.75689 0.04907995 [111,] 10.75935 0.04899303 [112,] 10.76183 0.04890409 [113,] 10.76183 0.04881308 [114,] 10.76683 0.04871995 [115,] 10.76936 0.04862466 [116,] 10.77190 0.04852716 [117,] 10.77190 0.04842741 [118,] 10.77704 0.04832534 [119,] 10.77963 0.04822091 [120,] 10.78224 0.04811407 [121,] 10.78487 0.04800475 [122,] 10.78752 0.04789290 [123,] 10.79019 0.04777846 [124,] 10.79287 0.04766137 [125,] 10.79557 0.04754157 [126,] 10.79829 0.04741899 [127,] 10.80103 0.04729357 [128,] 10.80103 0.04716522 [129,] 10.80656 0.04703390 [130,] 10.80936 0.04689951 [131,] 10.81217 0.04676198 [132,] 10.81326 0.04677244 [133,] 10.81436 0.04678243 [134,] 10.81547 0.04679193 [135,] 10.81658 0.04680093 [136,] 10.81770 0.04680942 [137,] 10.81883 0.04681740 [138,] 10.81996 0.04682484 [139,] 10.82111 0.04683174 [140,] 10.82226 0.04683808 [141,] 10.82342 0.04684384 [142,] 10.82459 0.04684903 [143,] 10.82577 0.04685362 [144,] 10.82696 0.04685760 [145,] 10.82815 0.04686095 [146,] 10.82936 0.04686366 [147,] 10.83057 0.04686572 [148,] 10.83179 0.04686711 [149,] 10.83302 0.04686782 [150,] 10.83426 0.04686782 [151,] 10.83551 0.04686710 [152,] 10.83677 0.04686565 [153,] 10.83804 0.04686344 [154,] 10.83932 0.04686047 [155,] 10.84061 0.04685670 [156,] 10.84190 0.04685213 [157,] 10.84321 0.04684673 [158,] 10.84453 0.04684049 [159,] 10.84586 0.04683337 [160,] 10.84720 0.04682537 [161,] 10.84854 0.04681646 [162,] 10.84990 0.04680662 [163,] 10.85127 0.04679583 [164,] 10.85265 0.04678406 [165,] 10.85404 0.04677128 [166,] 10.85545 0.04675749 [167,] 10.85686 0.04674264 [168,] 10.85828 0.04672671 [169,] 10.85972 0.04670969 [170,] 10.86117 0.04669153 [171,] 10.86263 0.04667221 [172,] 10.86410 0.04665171 [173,] 10.86558 0.04662999 [174,] 10.86708 0.04660702 [175,] 10.86858 0.04658278 [176,] 10.87010 0.04655722 [177,] 10.87164 0.04653032 [178,] 10.87318 0.04650204 [179,] 10.87474 0.04647234 [180,] 10.87631 0.04644120 [181,] 10.87789 0.04640856 [182,] 10.87949 0.04637440 [183,] 10.88110 0.04633868 [184,] 10.88273 0.04630134 [185,] 10.88437 0.04626236 [186,] 10.88602 0.04622168 [187,] 10.88769 0.04617927 [188,] 10.88937 0.04613507 [189,] 10.89107 0.04608903 [190,] 10.89278 0.04604112 [191,] 10.89451 0.04599127 [192,] 10.89625 0.04593944 [193,] 10.89800 0.04588557 [194,] 10.89978 0.04582960 [195,] 10.90157 0.04577147 [196,] 10.90337 0.04571113 [197,] 10.90519 0.04564852 [198,] 10.90703 0.04558356 [199,] 10.90888 0.04551620 [200,] 10.90847 0.04560886 [201,] 10.90805 0.04570208 [202,] 10.90762 0.04579584 [203,] 10.90719 0.04589016 [204,] 10.90676 0.04598504 [205,] 10.90632 0.04608050 [206,] 10.90588 0.04617652 [207,] 10.90544 0.04627313 [208,] 10.90499 0.04637032 [209,] 10.90453 0.04646810 [210,] 10.90453 0.04656648 [211,] 10.90408 0.04666546 [212,] 10.90315 0.04676504 [213,] 10.90268 0.04686524 [214,] 10.90220 0.04696606 [215,] 10.90172 0.04706750 [216,] 10.90123 0.04716957 [217,] 10.90074 0.04727229 [218,] 10.90074 0.04737564 [219,] 10.89975 0.04747964 [220,] 10.89924 0.04758430 [221,] 10.89873 0.04768963 [222,] 10.89822 0.04779562 [223,] 10.89770 0.04790228 [224,] 10.89717 0.04800963 [225,] 10.89664 0.04811767 [226,] 10.89664 0.04822640 [227,] 10.89556 0.04833584 [228,] 10.89501 0.04844598 [229,] 10.89446 0.04855684 [230,] 10.89390 0.04866842 [231,] 10.89333 0.04878074 [232,] 10.89276 0.04889379 [233,] 10.89276 0.04900759 [234,] 10.89218 0.04912214 [235,] 10.89101 0.04923745 [236,] 10.89041 0.04935352 [237,] 10.88981 0.04947038 [238,] 10.88920 0.04958801 [239,] 10.88858 0.04970644 [240,] 10.88796 0.04982567 [241,] 10.88796 0.04994570 [242,] 10.88669 0.05006655 [243,] 10.88604 0.05018822 [244,] 10.88539 0.05031072 [245,] 10.88473 0.05043406 [246,] 10.88406 0.05055825 [247,] 10.88338 0.05068330 [248,] 10.88270 0.05080921 [249,] 10.88270 0.05093600 [250,] 10.88131 0.05106367 [251,] 10.88060 0.05119223 [252,] 10.87988 0.05132169 [253,] 10.87915 0.05145206 [254,] 10.87842 0.05158335 [255,] 10.87768 0.05171557 [256,] 10.87768 0.05184872 [257,] 10.87616 0.05198282 [258,] 10.87539 0.05211788 [259,] 10.87461 0.05225390 [260,] 10.87382 0.05239089 [261,] 10.87302 0.05252887 [262,] 10.87220 0.05266785 [263,] 10.87138 0.05280782 [264,] 10.87055 0.05294881 [265,] 10.86971 0.05309082 [266,] 10.86885 0.05323387 [267,] 10.86799 0.05337796 [268,] 10.86711 0.05352310 [269,] 10.86622 0.05366930 [270,] 10.86532 0.05381657 [271,] 10.86441 0.05396493 [272,] 10.86348 0.05411438 [273,] 10.86254 0.05426492 [274,] 10.86159 0.05441659 [275,] 10.86063 0.05456937 [276,] 10.85965 0.05472328 [277,] 10.85866 0.05487834 [278,] 10.85765 0.05503454 [279,] 10.85663 0.05519191 > (midr <- midrange(x)) [1] 16 > 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/11ih01247675295.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/29zyc1247675295.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/3q5wy1247675296.tab") > > system("convert tmp/11ih01247675295.ps tmp/11ih01247675295.png") > system("convert tmp/29zyc1247675295.ps tmp/29zyc1247675295.png") > > > proc.time() user system elapsed 8.380 0.515 8.862