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(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) > 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.71325 > sqrtn <- sqrt(length(x)) > (armse <- sd(x) / sqrtn) [1] 0.0668372 > (armose <- arm / armse) [1] 160.2888 > (geo <- geomean(x)) [1] 10.53260 > (har <- harmean(x)) [1] 10.34235 > (qua <- quamean(x)) [1] 10.88472 > (win <- winmean(x)) [,1] [,2] [1,] 10.71325 0.06683720 [2,] 10.71566 0.06661004 [3,] 10.71566 0.06661004 [4,] 10.71084 0.06619096 [5,] 10.71084 0.06619096 [6,] 10.71084 0.06619096 [7,] 10.71084 0.06619096 [8,] 10.71084 0.06619096 [9,] 10.72169 0.06535247 [10,] 10.72169 0.06535247 [11,] 10.72169 0.06535247 [12,] 10.72169 0.06535247 [13,] 10.72169 0.06535247 [14,] 10.72169 0.06535247 [15,] 10.72169 0.06535247 [16,] 10.72169 0.06535247 [17,] 10.72169 0.06535247 [18,] 10.72169 0.06535247 [19,] 10.72169 0.06535247 [20,] 10.72169 0.06535247 [21,] 10.72169 0.06535247 [22,] 10.72169 0.06535247 [23,] 10.72169 0.06535247 [24,] 10.69277 0.06329582 [25,] 10.69277 0.06329582 [26,] 10.69277 0.06329582 [27,] 10.69277 0.06329582 [28,] 10.69277 0.06329582 [29,] 10.69277 0.06329582 [30,] 10.69277 0.06329582 [31,] 10.69277 0.06329582 [32,] 10.73133 0.06089003 [33,] 10.73133 0.06089003 [34,] 10.73133 0.06089003 [35,] 10.73133 0.06089003 [36,] 10.73133 0.06089003 [37,] 10.73133 0.06089003 [38,] 10.73133 0.06089003 [39,] 10.73133 0.06089003 [40,] 10.73133 0.06089003 [41,] 10.73133 0.06089003 [42,] 10.73133 0.06089003 [43,] 10.73133 0.06089003 [44,] 10.73133 0.06089003 [45,] 10.73133 0.06089003 [46,] 10.73133 0.06089003 [47,] 10.73133 0.06089003 [48,] 10.73133 0.06089003 [49,] 10.73133 0.06089003 [50,] 10.73133 0.06089003 [51,] 10.73133 0.06089003 [52,] 10.73133 0.06089003 [53,] 10.73133 0.06089003 [54,] 10.73133 0.06089003 [55,] 10.73133 0.06089003 [56,] 10.73133 0.06089003 [57,] 10.73133 0.06089003 [58,] 10.73133 0.06089003 [59,] 10.73133 0.06089003 [60,] 10.73133 0.06089003 [61,] 10.73133 0.06089003 [62,] 10.65663 0.05658543 [63,] 10.65663 0.05658543 [64,] 10.65663 0.05658543 [65,] 10.65663 0.05658543 [66,] 10.65663 0.05658543 [67,] 10.65663 0.05658543 [68,] 10.65663 0.05658543 [69,] 10.65663 0.05658543 [70,] 10.65663 0.05658543 [71,] 10.65663 0.05658543 [72,] 10.65663 0.05658543 [73,] 10.65663 0.05658543 [74,] 10.65663 0.05658543 [75,] 10.65663 0.05658543 [76,] 10.65663 0.05658543 [77,] 10.65663 0.05658543 [78,] 10.65663 0.05658543 [79,] 10.65663 0.05658543 [80,] 10.65663 0.05658543 [81,] 10.65663 0.05658543 [82,] 10.65663 0.05658543 [83,] 10.65663 0.05658543 [84,] 10.65663 0.05658543 [85,] 10.65663 0.05658543 [86,] 10.65663 0.05658543 [87,] 10.65663 0.05658543 [88,] 10.55060 0.05212330 [89,] 10.55060 0.05212330 [90,] 10.55060 0.05212330 [91,] 10.55060 0.05212330 [92,] 10.55060 0.05212330 [93,] 10.55060 0.05212330 [94,] 10.55060 0.05212330 [95,] 10.55060 0.05212330 [96,] 10.55060 0.05212330 [97,] 10.55060 0.05212330 [98,] 10.55060 0.05212330 [99,] 10.55060 0.05212330 [100,] 10.55060 0.05212330 [101,] 10.55060 0.05212330 [102,] 10.55060 0.05212330 [103,] 10.55060 0.05212330 [104,] 10.55060 0.05212330 [105,] 10.55060 0.05212330 [106,] 10.55060 0.05212330 [107,] 10.55060 0.05212330 [108,] 10.55060 0.05212330 [109,] 10.55060 0.05212330 [110,] 10.55060 0.05212330 [111,] 10.55060 0.05212330 [112,] 10.55060 0.05212330 [113,] 10.55060 0.05212330 [114,] 10.55060 0.05212330 [115,] 10.55060 0.05212330 [116,] 10.55060 0.05212330 [117,] 10.55060 0.05212330 [118,] 10.55060 0.05212330 [119,] 10.55060 0.05212330 [120,] 10.55060 0.05212330 [121,] 10.55060 0.05212330 [122,] 10.55060 0.05212330 [123,] 10.55060 0.05212330 [124,] 10.55060 0.05212330 [125,] 10.55060 0.05212330 [126,] 10.55060 0.05212330 [127,] 10.55060 0.05212330 [128,] 10.55060 0.05212330 [129,] 10.55060 0.05212330 [130,] 10.70723 0.04373086 [131,] 10.70723 0.04373086 [132,] 10.70723 0.04373086 [133,] 10.70723 0.04373086 [134,] 10.70723 0.04373086 [135,] 10.70723 0.04373086 [136,] 10.70723 0.04373086 [137,] 10.70723 0.04373086 [138,] 10.70723 0.04373086 [139,] 10.70723 0.04373086 [140,] 10.70723 0.04373086 [141,] 10.70723 0.04373086 [142,] 10.70723 0.04373086 [143,] 10.70723 0.04373086 [144,] 10.70723 0.04373086 [145,] 10.70723 0.04373086 [146,] 10.70723 0.04373086 [147,] 10.70723 0.04373086 [148,] 10.70723 0.04373086 [149,] 10.70723 0.04373086 [150,] 10.70723 0.04373086 [151,] 10.70723 0.04373086 [152,] 10.70723 0.04373086 [153,] 10.70723 0.04373086 [154,] 10.70723 0.04373086 [155,] 10.70723 0.04373086 [156,] 10.70723 0.04373086 [157,] 10.70723 0.04373086 [158,] 10.70723 0.04373086 [159,] 10.70723 0.04373086 [160,] 10.70723 0.04373086 [161,] 10.70723 0.04373086 [162,] 10.70723 0.04373086 [163,] 10.70723 0.04373086 [164,] 10.70723 0.04373086 [165,] 10.70723 0.04373086 [166,] 10.70723 0.04373086 [167,] 10.70723 0.04373086 [168,] 10.70723 0.04373086 [169,] 10.70723 0.04373086 [170,] 10.70723 0.04373086 [171,] 10.70723 0.04373086 [172,] 10.70723 0.04373086 [173,] 10.70723 0.04373086 [174,] 10.70723 0.04373086 [175,] 10.70723 0.04373086 [176,] 10.70723 0.04373086 [177,] 10.70723 0.04373086 [178,] 10.70723 0.04373086 [179,] 10.70723 0.04373086 [180,] 10.70723 0.04373086 [181,] 10.70723 0.04373086 [182,] 10.70723 0.04373086 [183,] 10.70723 0.04373086 [184,] 10.70723 0.04373086 [185,] 10.70723 0.04373086 [186,] 10.70723 0.04373086 [187,] 10.70723 0.04373086 [188,] 10.70723 0.04373086 [189,] 10.70723 0.04373086 [190,] 10.70723 0.04373086 [191,] 10.70723 0.04373086 [192,] 10.70723 0.04373086 [193,] 10.70723 0.04373086 [194,] 10.70723 0.04373086 [195,] 10.70723 0.04373086 [196,] 10.70723 0.04373086 [197,] 10.70723 0.04373086 [198,] 10.94578 0.03389621 [199,] 10.94578 0.03389621 [200,] 10.94578 0.03389621 [201,] 10.94578 0.03389621 [202,] 10.94578 0.03389621 [203,] 10.94578 0.03389621 [204,] 10.94578 0.03389621 [205,] 10.94578 0.03389621 [206,] 10.94578 0.03389621 [207,] 10.94578 0.03389621 [208,] 10.94578 0.03389621 [209,] 10.94578 0.03389621 [210,] 10.94578 0.03389621 [211,] 10.94578 0.03389621 [212,] 10.94578 0.03389621 [213,] 10.94578 0.03389621 [214,] 10.94578 0.03389621 [215,] 10.94578 0.03389621 [216,] 10.94578 0.03389621 [217,] 10.94578 0.03389621 [218,] 10.94578 0.03389621 [219,] 10.94578 0.03389621 [220,] 10.94578 0.03389621 [221,] 10.94578 0.03389621 [222,] 10.94578 0.03389621 [223,] 10.94578 0.03389621 [224,] 10.94578 0.03389621 [225,] 10.94578 0.03389621 [226,] 10.94578 0.03389621 [227,] 10.94578 0.03389621 [228,] 10.94578 0.03389621 [229,] 10.94578 0.03389621 [230,] 10.94578 0.03389621 [231,] 10.94578 0.03389621 [232,] 10.94578 0.03389621 [233,] 10.94578 0.03389621 [234,] 10.94578 0.03389621 [235,] 10.94578 0.03389621 [236,] 10.94578 0.03389621 [237,] 10.94578 0.03389621 [238,] 10.94578 0.03389621 [239,] 10.94578 0.03389621 [240,] 10.94578 0.03389621 [241,] 10.94578 0.03389621 [242,] 10.94578 0.03389621 [243,] 10.94578 0.03389621 [244,] 10.94578 0.03389621 [245,] 10.94578 0.03389621 [246,] 10.94578 0.03389621 [247,] 10.94578 0.03389621 [248,] 10.94578 0.03389621 [249,] 10.94578 0.03389621 [250,] 10.94578 0.03389621 [251,] 10.94578 0.03389621 [252,] 10.94578 0.03389621 [253,] 10.94578 0.03389621 [254,] 10.94578 0.03389621 [255,] 10.94578 0.03389621 [256,] 10.94578 0.03389621 [257,] 10.94578 0.03389621 [258,] 10.94578 0.03389621 [259,] 10.94578 0.03389621 [260,] 10.94578 0.03389621 [261,] 10.94578 0.03389621 [262,] 10.94578 0.03389621 [263,] 10.94578 0.03389621 [264,] 10.94578 0.03389621 [265,] 10.94578 0.03389621 [266,] 10.94578 0.03389621 [267,] 10.94578 0.03389621 [268,] 10.94578 0.03389621 [269,] 10.94578 0.03389621 [270,] 10.94578 0.03389621 [271,] 10.94578 0.03389621 [272,] 10.94578 0.03389621 [273,] 10.94578 0.03389621 [274,] 10.94578 0.03389621 [275,] 10.94578 0.03389621 [276,] 10.94578 0.03389621 > (tri <- trimean(x)) [,1] [,2] [1,] 10.71377 0.06633510 [2,] 10.71429 0.06582384 [3,] 10.71359 0.06542078 [4,] 10.71290 0.06501084 [5,] 10.71341 0.06470412 [6,] 10.71394 0.06439251 [7,] 10.71446 0.06407591 [8,] 10.71499 0.06375419 [9,] 10.71552 0.06342725 [10,] 10.71481 0.06319682 [11,] 10.71411 0.06296285 [12,] 10.71340 0.06272527 [13,] 10.71269 0.06248400 [14,] 10.71197 0.06223896 [15,] 10.71125 0.06199008 [16,] 10.71053 0.06173728 [17,] 10.70980 0.06148047 [18,] 10.70907 0.06121957 [19,] 10.70833 0.06095449 [20,] 10.70759 0.06068513 [21,] 10.70685 0.06041141 [22,] 10.70611 0.06013322 [23,] 10.70536 0.05985047 [24,] 10.70460 0.05956304 [25,] 10.70513 0.05937613 [26,] 10.70566 0.05918630 [27,] 10.70619 0.05899347 [28,] 10.70672 0.05879761 [29,] 10.70725 0.05859864 [30,] 10.70779 0.05839651 [31,] 10.70833 0.05819114 [32,] 10.70888 0.05798248 [33,] 10.70812 0.05786566 [34,] 10.70735 0.05774696 [35,] 10.70658 0.05762634 [36,] 10.70580 0.05750376 [37,] 10.70503 0.05737921 [38,] 10.70424 0.05725263 [39,] 10.70346 0.05712400 [40,] 10.70267 0.05699327 [41,] 10.70187 0.05686041 [42,] 10.70107 0.05672538 [43,] 10.70027 0.05658813 [44,] 10.69946 0.05644864 [45,] 10.69865 0.05630685 [46,] 10.69783 0.05616273 [47,] 10.69701 0.05601622 [48,] 10.69619 0.05586729 [49,] 10.69536 0.05571588 [50,] 10.69452 0.05556195 [51,] 10.69368 0.05540545 [52,] 10.69284 0.05524633 [53,] 10.69199 0.05508453 [54,] 10.69114 0.05492001 [55,] 10.69028 0.05475271 [56,] 10.68942 0.05458257 [57,] 10.68855 0.05440954 [58,] 10.68768 0.05423355 [59,] 10.68680 0.05405454 [60,] 10.68592 0.05387245 [61,] 10.68503 0.05368722 [62,] 10.68414 0.05349877 [63,] 10.68466 0.05341368 [64,] 10.68519 0.05332703 [65,] 10.68571 0.05323880 [66,] 10.68625 0.05314896 [67,] 10.68678 0.05305748 [68,] 10.68732 0.05296433 [69,] 10.68786 0.05286949 [70,] 10.68841 0.05277291 [71,] 10.68895 0.05267457 [72,] 10.68950 0.05257443 [73,] 10.69006 0.05247246 [74,] 10.69062 0.05236863 [75,] 10.69118 0.05226290 [76,] 10.69174 0.05215524 [77,] 10.69231 0.05204560 [78,] 10.69288 0.05193395 [79,] 10.69345 0.05182025 [80,] 10.69403 0.05170446 [81,] 10.69461 0.05158654 [82,] 10.69520 0.05146644 [83,] 10.69578 0.05134413 [84,] 10.69637 0.05121955 [85,] 10.69697 0.05109267 [86,] 10.69757 0.05096343 [87,] 10.69817 0.05083179 [88,] 10.69878 0.05069770 [89,] 10.70092 0.05064490 [90,] 10.70308 0.05059077 [91,] 10.70525 0.05053528 [92,] 10.70743 0.05047841 [93,] 10.70963 0.05042013 [94,] 10.71184 0.05036041 [95,] 10.71406 0.05029922 [96,] 10.71630 0.05023653 [97,] 10.71855 0.05017231 [98,] 10.72082 0.05010654 [99,] 10.72310 0.05003917 [100,] 10.72540 0.04997018 [101,] 10.72771 0.04989953 [102,] 10.73003 0.04982719 [103,] 10.73237 0.04975312 [104,] 10.73473 0.04967728 [105,] 10.73473 0.04959965 [106,] 10.73948 0.04952017 [107,] 10.74188 0.04943882 [108,] 10.74430 0.04935554 [109,] 10.74673 0.04927030 [110,] 10.74918 0.04918306 [111,] 10.75164 0.04909378 [112,] 10.75413 0.04900240 [113,] 10.75662 0.04890887 [114,] 10.75914 0.04881317 [115,] 10.76167 0.04871522 [116,] 10.76421 0.04861499 [117,] 10.76678 0.04851242 [118,] 10.76936 0.04840746 [119,] 10.77196 0.04830005 [120,] 10.77458 0.04819013 [121,] 10.77721 0.04807766 [122,] 10.77986 0.04796255 [123,] 10.78253 0.04784477 [124,] 10.78522 0.04772423 [125,] 10.78793 0.04760088 [126,] 10.79066 0.04747464 [127,] 10.79340 0.04734544 [128,] 10.79617 0.04721322 [129,] 10.79895 0.04707789 [130,] 10.80175 0.04693939 [131,] 10.80282 0.04695022 [132,] 10.80389 0.04696057 [133,] 10.80496 0.04697044 [134,] 10.80605 0.04697980 [135,] 10.80714 0.04698865 [136,] 10.80824 0.04699697 [137,] 10.80935 0.04700476 [138,] 10.81047 0.04701200 [139,] 10.81159 0.04701867 [140,] 10.81273 0.04702477 [141,] 10.81387 0.04703028 [142,] 10.81502 0.04703519 [143,] 10.81618 0.04703948 [144,] 10.81734 0.04704314 [145,] 10.81852 0.04704615 [146,] 10.81970 0.04704850 [147,] 10.82090 0.04705017 [148,] 10.82210 0.04705115 [149,] 10.82331 0.04705142 [150,] 10.82453 0.04705096 [151,] 10.82576 0.04704976 [152,] 10.82700 0.04704780 [153,] 10.82824 0.04704505 [154,] 10.82950 0.04704151 [155,] 10.83077 0.04703715 [156,] 10.83205 0.04703195 [157,] 10.83333 0.04702589 [158,] 10.83463 0.04701896 [159,] 10.83594 0.04701113 [160,] 10.83725 0.04700237 [161,] 10.83858 0.04699267 [162,] 10.83992 0.04698200 [163,] 10.84127 0.04697035 [164,] 10.84263 0.04695767 [165,] 10.84400 0.04694396 [166,] 10.84538 0.04692918 [167,] 10.84677 0.04691331 [168,] 10.84818 0.04689632 [169,] 10.84959 0.04687818 [170,] 10.85102 0.04685887 [171,] 10.85246 0.04683835 [172,] 10.85391 0.04681659 [173,] 10.85537 0.04679357 [174,] 10.85685 0.04676924 [175,] 10.85833 0.04674359 [176,] 10.85983 0.04671656 [177,] 10.86134 0.04668814 [178,] 10.86287 0.04665827 [179,] 10.86441 0.04662693 [180,] 10.86596 0.04659408 [181,] 10.86752 0.04655967 [182,] 10.86910 0.04652367 [183,] 10.87069 0.04648603 [184,] 10.87229 0.04644671 [185,] 10.87391 0.04640566 [186,] 10.87555 0.04636285 [187,] 10.87719 0.04631821 [188,] 10.87885 0.04627171 [189,] 10.88053 0.04622329 [190,] 10.88222 0.04617290 [191,] 10.88393 0.04612048 [192,] 10.88565 0.04606598 [193,] 10.88739 0.04600934 [194,] 10.88914 0.04595051 [195,] 10.89091 0.04588941 [196,] 10.89269 0.04582599 [197,] 10.89450 0.04576017 [198,] 10.89631 0.04569190 [199,] 10.89583 0.04578526 [200,] 10.89535 0.04587918 [201,] 10.89486 0.04597364 [202,] 10.89437 0.04606867 [203,] 10.89387 0.04616426 [204,] 10.89336 0.04626042 [205,] 10.89286 0.04635716 [206,] 10.89234 0.04645447 [207,] 10.89183 0.04655237 [208,] 10.89130 0.04665087 [209,] 10.89078 0.04674995 [210,] 10.89078 0.04684964 [211,] 10.88971 0.04694994 [212,] 10.88916 0.04705085 [213,] 10.88916 0.04715238 [214,] 10.88806 0.04725454 [215,] 10.88750 0.04735732 [216,] 10.88693 0.04746075 [217,] 10.88636 0.04756481 [218,] 10.88579 0.04766952 [219,] 10.88520 0.04777489 [220,] 10.88462 0.04788092 [221,] 10.88402 0.04798762 [222,] 10.88342 0.04809498 [223,] 10.88281 0.04820303 [224,] 10.88220 0.04831177 [225,] 10.88158 0.04842120 [226,] 10.88095 0.04853132 [227,] 10.88032 0.04864216 [228,] 10.87968 0.04875370 [229,] 10.87903 0.04886597 [230,] 10.87838 0.04897896 [231,] 10.87772 0.04909268 [232,] 10.87705 0.04920714 [233,] 10.87637 0.04932235 [234,] 10.87569 0.04943832 [235,] 10.87500 0.04955505 [236,] 10.87430 0.04967254 [237,] 10.87360 0.04979081 [238,] 10.87288 0.04990986 [239,] 10.87216 0.05002971 [240,] 10.87143 0.05015035 [241,] 10.87069 0.05027180 [242,] 10.86994 0.05039406 [243,] 10.86919 0.05051714 [244,] 10.86842 0.05064105 [245,] 10.86765 0.05076579 [246,] 10.86686 0.05089138 [247,] 10.86607 0.05101782 [248,] 10.86527 0.05114512 [249,] 10.86446 0.05127329 [250,] 10.86364 0.05140233 [251,] 10.86280 0.05153226 [252,] 10.86196 0.05166308 [253,] 10.86111 0.05179479 [254,] 10.86025 0.05192742 [255,] 10.85938 0.05206096 [256,] 10.85849 0.05219543 [257,] 10.85759 0.05233082 [258,] 10.85669 0.05246716 [259,] 10.85577 0.05260444 [260,] 10.85484 0.05274268 [261,] 10.85390 0.05288189 [262,] 10.85294 0.05302207 [263,] 10.85197 0.05316323 [264,] 10.85099 0.05330538 [265,] 10.85000 0.05344852 [266,] 10.84899 0.05359267 [267,] 10.84797 0.05373784 [268,] 10.84694 0.05388402 [269,] 10.84589 0.05403123 [270,] 10.84483 0.05417948 [271,] 10.84375 0.05432877 [272,] 10.84266 0.05447912 [273,] 10.84155 0.05463052 [274,] 10.84043 0.05478299 [275,] 10.83929 0.05493652 [276,] 10.83813 0.05509114 > (midr <- midrange(x)) [1] 10.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/1mzih1250526258.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/2hdyq1250526258.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/304mz1250526258.tab") > > system("convert tmp/1mzih1250526258.ps tmp/1mzih1250526258.png") > system("convert tmp/2hdyq1250526258.ps tmp/2hdyq1250526258.png") > > > proc.time() user system elapsed 7.974 0.463 8.352