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(8 + ,10 + ,10 + ,13 + ,14 + ,12 + ,11 + ,8 + ,8 + ,10 + ,10 + ,12 + ,12 + ,12 + ,11 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,10 + ,12 + ,10 + ,11 + ,10 + ,10 + ,12 + ,10 + ,12 + ,7 + ,12 + ,12 + ,11 + ,13 + ,10 + ,10 + ,10 + ,8 + ,12 + ,10 + ,10 + ,8 + ,14 + ,9 + ,8 + ,12 + ,15 + ,14 + ,9 + ,7 + ,8 + ,12 + ,12 + ,10 + ,10 + ,8 + ,8 + ,14 + ,13 + ,10 + ,12 + ,9 + ,12 + ,11 + ,10 + ,8 + ,8 + ,9 + ,12 + ,8 + ,12 + ,10 + ,12 + ,9 + ,8 + ,12 + ,8 + ,12 + ,10 + ,12 + ,9 + ,10 + ,12 + ,9 + ,14 + ,12 + ,12 + ,13 + ,13 + ,14 + ,12 + ,12 + ,10 + ,11 + ,12 + ,14 + ,10 + ,12 + ,12 + ,12 + ,10 + ,12 + ,12 + ,12 + ,9 + ,12 + ,12 + ,13 + ,8 + ,12 + ,10 + ,10 + ,10 + ,9 + ,12 + ,9 + ,10 + ,8 + ,12 + ,10 + ,8 + ,8 + ,9 + ,12 + ,12 + ,10 + ,10 + ,9 + ,11 + ,10 + ,9 + ,15 + ,10 + ,8 + ,10 + ,8 + ,9 + ,9 + ,12 + ,12 + ,12 + ,12 + ,10 + ,12 + ,8 + ,9 + ,12 + ,12 + ,8 + ,14 + ,10 + ,12 + ,8 + ,11 + ,10 + ,12 + ,12 + ,12 + ,12 + ,8 + ,10 + ,7 + ,10 + ,10 + ,12 + ,11 + ,9 + ,10 + ,12 + ,14 + ,13 + ,10 + ,11 + ,10 + ,10 + ,8 + ,10 + ,10 + ,10 + ,8 + ,8 + ,14 + ,8 + ,12 + ,12 + ,10 + ,8 + ,12 + ,12 + ,10 + ,10 + ,12 + ,12 + ,9 + ,11 + ,14 + ,10 + ,8 + ,12 + ,8 + ,10 + ,11 + ,12 + ,10 + ,10 + ,12 + ,8 + ,9 + ,12 + ,8 + ,8 + ,10 + ,10 + ,10 + ,14 + ,10 + ,12 + ,12 + ,13 + ,9 + ,12 + ,12 + ,10 + ,12 + ,8 + ,12 + ,10 + ,9 + ,11 + ,11 + ,9 + ,10 + ,15 + ,12 + ,7 + ,7 + ,10 + ,9 + ,10 + ,10 + ,9 + ,12 + ,10 + ,9 + ,12 + ,10 + ,7 + ,12 + ,10 + ,10 + ,12 + ,8 + ,12 + ,10 + ,10 + ,9 + ,8 + ,8 + ,12 + ,12 + ,10 + ,12 + ,10 + ,9 + ,10 + ,10 + ,8 + ,10 + ,12 + ,12 + ,10 + ,9 + ,12 + ,12 + ,10 + ,7 + ,12 + ,10 + ,10 + ,9 + ,18 + ,13 + ,10 + ,12 + ,15 + ,12 + ,12 + ,9 + ,7 + ,12 + ,13 + ,14 + ,13 + ,12 + ,8 + ,8 + ,10 + ,10 + ,8 + ,12 + ,10 + ,12 + ,12 + ,12 + ,9 + ,12 + ,7 + ,12 + ,8 + ,8 + ,12 + ,14 + ,10 + ,9 + ,8 + ,13 + ,10 + ,10 + ,14 + ,10 + ,10 + ,12 + ,14 + ,8 + ,14 + ,12 + ,12 + ,10 + ,10 + ,8 + ,12 + ,12 + ,12 + ,10 + ,12 + ,10 + ,10 + ,12 + ,12 + ,12 + ,12 + ,13 + ,12 + ,8 + ,10 + ,12 + ,8 + ,10 + ,10 + ,12 + ,12 + ,12 + ,12 + ,12 + ,12 + ,14 + ,10 + ,12 + ,14 + ,12 + ,14 + ,12 + ,13 + ,8 + ,12 + ,14 + ,10 + ,10 + ,11 + ,12 + ,10 + ,10 + ,8 + ,11 + ,12 + ,12 + ,11 + ,10 + ,9 + ,14 + ,12 + ,10 + ,12 + ,10 + ,12 + ,12 + ,8 + ,12 + ,12 + ,10 + ,12 + ,10 + ,10 + ,10 + ,12 + ,12 + ,12 + ,12 + ,9 + ,12 + ,14 + ,8 + ,12 + ,10 + ,10 + ,10 + ,7 + ,8 + ,10 + ,10 + ,10 + ,9 + ,15 + ,10 + ,12 + ,12 + ,12 + ,11 + ,12 + ,12 + ,14 + ,8 + ,12 + ,12 + ,10 + ,14 + ,8 + ,10 + ,12 + ,10 + ,10 + ,10 + ,12 + ,9 + ,12 + ,11 + ,8 + ,14 + ,12 + ,10 + ,12 + ,10 + ,8 + ,14 + ,12 + ,12 + ,12 + ,8 + ,12 + ,12 + ,10 + ,12 + ,12 + ,12 + ,9 + ,11 + ,10 + ,15 + ,10 + ,9 + ,9 + ,10 + ,7 + ,10 + ,9 + ,10 + ,10 + ,10 + ,15 + ,12 + ,12 + ,10 + ,12 + ,8 + ,12 + ,11 + ,8 + ,14 + ,8 + ,12 + ,10 + ,15 + ,9 + ,13 + ,12 + ,14 + ,12 + ,12 + ,17 + ,10 + ,13 + ,12 + ,12 + ,10 + ,12 + ,10 + ,12 + ,10 + ,10 + ,10 + ,8 + ,12 + ,10 + ,10 + ,10 + ,12 + ,12 + ,11 + ,12 + ,8 + ,8 + ,12 + ,12 + ,10 + ,12 + ,9 + ,10 + ,12 + ,12 + ,12 + ,12 + ,10 + ,10 + ,9 + ,12 + ,10 + ,9 + ,12 + ,7 + ,14 + ,10 + ,10 + ,9 + ,10 + ,8 + ,10 + ,12 + ,12 + ,10 + ,9 + ,10 + ,9 + ,12 + ,10 + ,12 + ,10 + ,9 + ,7 + ,12 + ,11 + ,12 + ,9 + ,13 + ,12 + ,12 + ,7 + ,8 + ,12 + ,12 + ,12 + ,11 + ,12 + ,13 + ,10 + ,12 + ,10 + ,12 + ,12 + ,15 + ,12 + ,12 + ,13 + ,10 + ,10 + ,8 + ,11 + ,12 + ,12 + ,12 + ,12 + ,10 + ,10 + ,12 + ,15 + ,12 + ,10 + ,10 + ,7 + ,12 + ,10 + ,11 + ,10 + ,10 + ,10 + ,10 + ,11 + ,7 + ,15 + ,8 + ,10 + ,8 + ,9 + ,8 + ,7 + ,10 + ,12 + ,14 + ,11 + ,8 + ,10 + ,8 + ,8 + ,14 + ,12 + ,15 + ,12 + ,12 + ,9 + ,12 + ,12 + ,9 + ,11 + ,15 + ,11 + ,12 + ,7 + ,15 + ,9 + ,10 + ,15 + ,15 + ,8 + ,11 + ,12 + ,10 + ,10 + ,12 + ,7 + ,12 + ,10 + ,11 + ,12 + ,10 + ,10 + ,8 + ,9 + ,8 + ,10 + ,10 + ,14 + ,10 + ,10 + ,12 + ,12 + ,7 + ,12 + ,10 + ,12 + ,9 + ,9 + ,13 + ,14 + ,10 + ,12 + ,12 + ,12 + ,12 + ,12 + ,10 + ,10 + ,8 + ,12 + ,8 + ,14 + ,10 + ,70 + ,12 + ,10 + ,8 + ,8 + ,11 + ,10 + ,8 + ,7 + ,8 + ,9 + ,12 + ,12 + ,7 + ,10 + ,8 + ,10 + ,10 + ,10 + ,8 + ,12 + ,7 + ,13 + ,13 + ,8 + ,8 + ,11 + ,12 + ,9 + ,12 + ,13 + ,13 + ,12 + ,12 + ,10 + ,8 + ,12 + ,10 + ,10 + ,15 + ,12 + ,10 + ,12 + ,8 + ,8 + ,12 + ,12 + ,10 + ,12 + ,9 + ,12 + ,12 + ,10 + ,9 + ,10 + ,10 + ,10 + ,12 + ,12 + ,12 + ,12 + ,8 + ,10 + ,12 + ,15 + ,10 + ,8 + ,15 + ,10 + ,9 + ,12 + ,10 + ,10 + ,11 + ,11 + ,12 + ,12 + ,14 + ,12 + ,14 + ,9 + ,10 + ,12 + ,13 + ,10 + ,11 + ,10 + ,12 + ,12 + ,12 + ,13 + ,14 + ,9 + ,10 + ,10 + ,12 + ,12 + ,10 + ,8 + ,12 + ,12 + ,10 + ,12 + ,10 + ,12 + ,12 + ,12 + ,10 + ,12 + ,12 + ,10 + ,10 + ,12 + ,12 + ,12 + ,9 + ,12 + ,12 + ,9 + ,12 + ,12 + ,12 + ,15 + ,12 + ,12 + ,12 + ,8 + ,8 + ,12 + ,8 + ,12 + ,12 + ,10 + ,10 + ,12 + ,8 + ,8 + ,10 + ,10 + ,9 + ,9 + ,9 + ,10 + ,12) > ylimmax = '' > ylimmin = '' > main = 'Robustness of Central Tendency' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > #Technical description: Write here your technical program description (don't use hard returns!) > geomean <- function(x) { + return(exp(mean(log(x)))) + } > harmean <- function(x) { + return(1/mean(1/x)) + } > quamean <- function(x) { + return(sqrt(mean(x*x))) + } > winmean <- function(x) { + x <-sort(x[!is.na(x)]) + n<-length(x) + denom <- 3 + nodenom <- n/denom + if (nodenom>40) denom <- n/40 + sqrtn = sqrt(n) + roundnodenom = floor(nodenom) + win <- array(NA,dim=c(roundnodenom,2)) + for (j in 1:roundnodenom) { + win[j,1] <- (j*x[j+1]+sum(x[(j+1):(n-j)])+j*x[n-j])/n + win[j,2] <- sd(c(rep(x[j+1],j),x[(j+1):(n-j)],rep(x[n-j],j)))/sqrtn + } + return(win) + } > trimean <- function(x) { + x <-sort(x[!is.na(x)]) + n<-length(x) + denom <- 3 + nodenom <- n/denom + if (nodenom>40) denom <- n/40 + sqrtn = sqrt(n) + roundnodenom = floor(nodenom) + tri <- array(NA,dim=c(roundnodenom,2)) + for (j in 1:roundnodenom) { + tri[j,1] <- mean(x,trim=j/n) + tri[j,2] <- sd(x[(j+1):(n-j)]) / sqrt(n-j*2) + } + return(tri) + } > midrange <- function(x) { + return((max(x)+min(x))/2) + } > q1 <- function(data,n,p,i,f) { + np <- n*p; + i <<- floor(np) + f <<- np - i + qvalue <- (1-f)*data[i] + f*data[i+1] + } > q2 <- function(data,n,p,i,f) { + np <- (n+1)*p + i <<- floor(np) + f <<- np - i + qvalue <- (1-f)*data[i] + f*data[i+1] + } > q3 <- function(data,n,p,i,f) { + np <- n*p + i <<- floor(np) + f <<- np - i + if (f==0) { + qvalue <- data[i] + } else { + qvalue <- data[i+1] + } + } > q4 <- function(data,n,p,i,f) { + np <- n*p + i <<- floor(np) + f <<- np - i + if (f==0) { + qvalue <- (data[i]+data[i+1])/2 + } else { + qvalue <- data[i+1] + } + } > q5 <- function(data,n,p,i,f) { + np <- (n-1)*p + i <<- floor(np) + f <<- np - i + if (f==0) { + qvalue <- data[i+1] + } else { + qvalue <- data[i+1] + f*(data[i+2]-data[i+1]) + } + } > q6 <- function(data,n,p,i,f) { + np <- n*p+0.5 + i <<- floor(np) + f <<- np - i + qvalue <- data[i] + } > q7 <- function(data,n,p,i,f) { + np <- (n+1)*p + i <<- floor(np) + f <<- np - i + if (f==0) { + qvalue <- data[i] + } else { + qvalue <- f*data[i] + (1-f)*data[i+1] + } + } > q8 <- function(data,n,p,i,f) { + np <- (n+1)*p + i <<- floor(np) + f <<- np - i + if (f==0) { + qvalue <- data[i] + } else { + if (f == 0.5) { + qvalue <- (data[i]+data[i+1])/2 + } else { + if (f < 0.5) { + qvalue <- data[i] + } else { + qvalue <- data[i+1] + } + } + } + } > midmean <- function(x,def) { + x <-sort(x[!is.na(x)]) + n<-length(x) + if (def==1) { + qvalue1 <- q1(x,n,0.25,i,f) + qvalue3 <- q1(x,n,0.75,i,f) + } + if (def==2) { + qvalue1 <- q2(x,n,0.25,i,f) + qvalue3 <- q2(x,n,0.75,i,f) + } + if (def==3) { + qvalue1 <- q3(x,n,0.25,i,f) + qvalue3 <- q3(x,n,0.75,i,f) + } + if (def==4) { + qvalue1 <- q4(x,n,0.25,i,f) + qvalue3 <- q4(x,n,0.75,i,f) + } + if (def==5) { + qvalue1 <- q5(x,n,0.25,i,f) + qvalue3 <- q5(x,n,0.75,i,f) + } + if (def==6) { + qvalue1 <- q6(x,n,0.25,i,f) + qvalue3 <- q6(x,n,0.75,i,f) + } + if (def==7) { + qvalue1 <- q7(x,n,0.25,i,f) + qvalue3 <- q7(x,n,0.75,i,f) + } + if (def==8) { + qvalue1 <- q8(x,n,0.25,i,f) + qvalue3 <- q8(x,n,0.75,i,f) + } + midm <- 0 + myn <- 0 + roundno4 <- round(n/4) + round3no4 <- round(3*n/4) + for (i in 1:n) { + if ((x[i]>=qvalue1) & (x[i]<=qvalue3)){ + midm = midm + x[i] + myn = myn + 1 + } + } + midm = midm / myn + return(midm) + } > (arm <- mean(x)) [1] 10.83049 > sqrtn <- sqrt(length(x)) > (armse <- sd(x) / sqrtn) [1] 0.0971422 > (armose <- arm / armse) [1] 111.4911 > (geo <- geomean(x)) [1] 10.61856 > (har <- harmean(x)) [1] 10.43728 > (qua <- quamean(x)) [1] 11.18159 > (win <- winmean(x)) [,1] [,2] [1,] 10.76707 0.06553710 [2,] 10.76463 0.06523038 [3,] 10.75732 0.06450883 [4,] 10.75732 0.06450883 [5,] 10.75732 0.06450883 [6,] 10.75732 0.06450883 [7,] 10.75732 0.06450883 [8,] 10.75732 0.06450883 [9,] 10.75732 0.06450883 [10,] 10.75732 0.06450883 [11,] 10.75732 0.06450883 [12,] 10.75732 0.06450883 [13,] 10.75732 0.06450883 [14,] 10.75732 0.06450883 [15,] 10.75732 0.06450883 [16,] 10.75732 0.06450883 [17,] 10.75732 0.06450883 [18,] 10.75732 0.06450883 [19,] 10.75732 0.06450883 [20,] 10.75732 0.06450883 [21,] 10.75732 0.06450883 [22,] 10.75732 0.06450883 [23,] 10.75732 0.06067885 [24,] 10.75732 0.06067885 [25,] 10.75732 0.06067885 [26,] 10.75732 0.06067885 [27,] 10.75732 0.06067885 [28,] 10.75732 0.06067885 [29,] 10.75732 0.06067885 [30,] 10.75732 0.06067885 [31,] 10.75732 0.06067885 [32,] 10.75732 0.06067885 [33,] 10.75732 0.06067885 [34,] 10.75732 0.06067885 [35,] 10.75732 0.06067885 [36,] 10.75732 0.06067885 [37,] 10.75732 0.06067885 [38,] 10.75732 0.06067885 [39,] 10.75732 0.06067885 [40,] 10.75732 0.06067885 [41,] 10.75732 0.06067885 [42,] 10.75732 0.06067885 [43,] 10.75732 0.06067885 [44,] 10.75732 0.06067885 [45,] 10.75732 0.06067885 [46,] 10.75732 0.06067885 [47,] 10.75732 0.06067885 [48,] 10.75732 0.06067885 [49,] 10.75732 0.06067885 [50,] 10.75732 0.06067885 [51,] 10.75732 0.06067885 [52,] 10.75732 0.06067885 [53,] 10.75732 0.06067885 [54,] 10.75732 0.06067885 [55,] 10.75732 0.06067885 [56,] 10.75732 0.06067885 [57,] 10.75732 0.06067885 [58,] 10.75732 0.06067885 [59,] 10.75732 0.06067885 [60,] 10.75732 0.06067885 [61,] 10.68293 0.05636424 [62,] 10.68293 0.05636424 [63,] 10.68293 0.05636424 [64,] 10.68293 0.05636424 [65,] 10.68293 0.05636424 [66,] 10.68293 0.05636424 [67,] 10.68293 0.05636424 [68,] 10.68293 0.05636424 [69,] 10.68293 0.05636424 [70,] 10.68293 0.05636424 [71,] 10.68293 0.05636424 [72,] 10.68293 0.05636424 [73,] 10.68293 0.05636424 [74,] 10.68293 0.05636424 [75,] 10.68293 0.05636424 [76,] 10.68293 0.05636424 [77,] 10.68293 0.05636424 [78,] 10.68293 0.05636424 [79,] 10.68293 0.05636424 [80,] 10.68293 0.05636424 [81,] 10.68293 0.05636424 [82,] 10.68293 0.05636424 [83,] 10.68293 0.05636424 [84,] 10.68293 0.05636424 [85,] 10.68293 0.05636424 [86,] 10.68293 0.05636424 [87,] 10.57683 0.05188831 [88,] 10.57683 0.05188831 [89,] 10.57683 0.05188831 [90,] 10.57683 0.05188831 [91,] 10.57683 0.05188831 [92,] 10.57683 0.05188831 [93,] 10.57683 0.05188831 [94,] 10.57683 0.05188831 [95,] 10.57683 0.05188831 [96,] 10.57683 0.05188831 [97,] 10.57683 0.05188831 [98,] 10.57683 0.05188831 [99,] 10.57683 0.05188831 [100,] 10.57683 0.05188831 [101,] 10.57683 0.05188831 [102,] 10.57683 0.05188831 [103,] 10.57683 0.05188831 [104,] 10.57683 0.05188831 [105,] 10.57683 0.05188831 [106,] 10.57683 0.05188831 [107,] 10.57683 0.05188831 [108,] 10.57683 0.05188831 [109,] 10.57683 0.05188831 [110,] 10.57683 0.05188831 [111,] 10.57683 0.05188831 [112,] 10.57683 0.05188831 [113,] 10.57683 0.05188831 [114,] 10.57683 0.05188831 [115,] 10.57683 0.05188831 [116,] 10.57683 0.05188831 [117,] 10.57683 0.05188831 [118,] 10.57683 0.05188831 [119,] 10.57683 0.05188831 [120,] 10.57683 0.05188831 [121,] 10.72439 0.04378855 [122,] 10.72439 0.04378855 [123,] 10.72439 0.04378855 [124,] 10.72439 0.04378855 [125,] 10.72439 0.04378855 [126,] 10.72439 0.04378855 [127,] 10.72439 0.04378855 [128,] 10.72439 0.04378855 [129,] 10.72439 0.04378855 [130,] 10.72439 0.04378855 [131,] 10.72439 0.04378855 [132,] 10.72439 0.04378855 [133,] 10.72439 0.04378855 [134,] 10.72439 0.04378855 [135,] 10.72439 0.04378855 [136,] 10.72439 0.04378855 [137,] 10.72439 0.04378855 [138,] 10.72439 0.04378855 [139,] 10.72439 0.04378855 [140,] 10.72439 0.04378855 [141,] 10.72439 0.04378855 [142,] 10.72439 0.04378855 [143,] 10.72439 0.04378855 [144,] 10.72439 0.04378855 [145,] 10.72439 0.04378855 [146,] 10.72439 0.04378855 [147,] 10.72439 0.04378855 [148,] 10.72439 0.04378855 [149,] 10.72439 0.04378855 [150,] 10.72439 0.04378855 [151,] 10.72439 0.04378855 [152,] 10.72439 0.04378855 [153,] 10.72439 0.04378855 [154,] 10.72439 0.04378855 [155,] 10.72439 0.04378855 [156,] 10.72439 0.04378855 [157,] 10.72439 0.04378855 [158,] 10.72439 0.04378855 [159,] 10.72439 0.04378855 [160,] 10.72439 0.04378855 [161,] 10.72439 0.04378855 [162,] 10.72439 0.04378855 [163,] 10.72439 0.04378855 [164,] 10.72439 0.04378855 [165,] 10.72439 0.04378855 [166,] 10.72439 0.04378855 [167,] 10.72439 0.04378855 [168,] 10.72439 0.04378855 [169,] 10.72439 0.04378855 [170,] 10.72439 0.04378855 [171,] 10.72439 0.04378855 [172,] 10.72439 0.04378855 [173,] 10.72439 0.04378855 [174,] 10.72439 0.04378855 [175,] 10.72439 0.04378855 [176,] 10.72439 0.04378855 [177,] 10.72439 0.04378855 [178,] 10.72439 0.04378855 [179,] 10.72439 0.04378855 [180,] 10.72439 0.04378855 [181,] 10.72439 0.04378855 [182,] 10.72439 0.04378855 [183,] 10.72439 0.04378855 [184,] 10.72439 0.04378855 [185,] 10.72439 0.04378855 [186,] 10.72439 0.04378855 [187,] 10.72439 0.04378855 [188,] 10.72439 0.04378855 [189,] 10.95488 0.03410896 [190,] 10.95488 0.03410896 [191,] 10.95488 0.03410896 [192,] 10.95488 0.03410896 [193,] 10.95488 0.03410896 [194,] 10.95488 0.03410896 [195,] 10.95488 0.03410896 [196,] 10.95488 0.03410896 [197,] 10.95488 0.03410896 [198,] 10.95488 0.03410896 [199,] 10.95488 0.03410896 [200,] 10.95488 0.03410896 [201,] 10.95488 0.03410896 [202,] 10.95488 0.03410896 [203,] 10.95488 0.03410896 [204,] 10.95488 0.03410896 [205,] 10.95488 0.03410896 [206,] 10.95488 0.03410896 [207,] 10.95488 0.03410896 [208,] 10.95488 0.03410896 [209,] 10.95488 0.03410896 [210,] 10.95488 0.03410896 [211,] 10.95488 0.03410896 [212,] 10.95488 0.03410896 [213,] 10.95488 0.03410896 [214,] 10.95488 0.03410896 [215,] 10.95488 0.03410896 [216,] 10.95488 0.03410896 [217,] 10.95488 0.03410896 [218,] 10.95488 0.03410896 [219,] 10.95488 0.03410896 [220,] 10.95488 0.03410896 [221,] 10.95488 0.03410896 [222,] 10.95488 0.03410896 [223,] 10.95488 0.03410896 [224,] 10.95488 0.03410896 [225,] 10.95488 0.03410896 [226,] 10.95488 0.03410896 [227,] 10.95488 0.03410896 [228,] 10.95488 0.03410896 [229,] 10.95488 0.03410896 [230,] 10.95488 0.03410896 [231,] 10.95488 0.03410896 [232,] 10.95488 0.03410896 [233,] 10.95488 0.03410896 [234,] 10.95488 0.03410896 [235,] 10.95488 0.03410896 [236,] 10.95488 0.03410896 [237,] 10.95488 0.03410896 [238,] 10.95488 0.03410896 [239,] 10.95488 0.03410896 [240,] 10.95488 0.03410896 [241,] 10.95488 0.03410896 [242,] 10.95488 0.03410896 [243,] 10.95488 0.03410896 [244,] 10.95488 0.03410896 [245,] 10.95488 0.03410896 [246,] 10.95488 0.03410896 [247,] 10.95488 0.03410896 [248,] 10.95488 0.03410896 [249,] 10.95488 0.03410896 [250,] 10.95488 0.03410896 [251,] 10.95488 0.03410896 [252,] 10.95488 0.03410896 [253,] 10.95488 0.03410896 [254,] 10.95488 0.03410896 [255,] 10.95488 0.03410896 [256,] 10.95488 0.03410896 [257,] 10.95488 0.03410896 [258,] 10.95488 0.03410896 [259,] 10.95488 0.03410896 [260,] 10.95488 0.03410896 [261,] 10.95488 0.03410896 [262,] 10.95488 0.03410896 [263,] 10.95488 0.03410896 [264,] 10.95488 0.03410896 [265,] 10.95488 0.03410896 [266,] 10.95488 0.03410896 [267,] 10.95488 0.03410896 [268,] 10.95488 0.03410896 [269,] 10.95488 0.03410896 [270,] 10.95488 0.03410896 [271,] 10.95488 0.03410896 [272,] 10.95488 0.03410896 [273,] 10.95488 0.03410896 > (tri <- trimean(x)) [,1] [,2] [1,] 10.76284 0.06493548 [2,] 10.75858 0.06432150 [3,] 10.75553 0.06385452 [4,] 10.75493 0.06362978 [5,] 10.75432 0.06340159 [6,] 10.75371 0.06316991 [7,] 10.75310 0.06293466 [8,] 10.75249 0.06269576 [9,] 10.75187 0.06245315 [10,] 10.75125 0.06220674 [11,] 10.75063 0.06195646 [12,] 10.75000 0.06170223 [13,] 10.74937 0.06144395 [14,] 10.74874 0.06118155 [15,] 10.74874 0.06091493 [16,] 10.74746 0.06064401 [17,] 10.74682 0.06036868 [18,] 10.74617 0.06008884 [19,] 10.74552 0.05980440 [20,] 10.74487 0.05951525 [21,] 10.74422 0.05922128 [22,] 10.74356 0.05892237 [23,] 10.74289 0.05861841 [24,] 10.74223 0.05851061 [25,] 10.74156 0.05840109 [26,] 10.74089 0.05828980 [27,] 10.74021 0.05817673 [28,] 10.73953 0.05806183 [29,] 10.73953 0.05794507 [30,] 10.73885 0.05782644 [31,] 10.73747 0.05770588 [32,] 10.73677 0.05758337 [33,] 10.73607 0.05745887 [34,] 10.73537 0.05733235 [35,] 10.73467 0.05720377 [36,] 10.73396 0.05707310 [37,] 10.73324 0.05694029 [38,] 10.73253 0.05680531 [39,] 10.73181 0.05666811 [40,] 10.73108 0.05652866 [41,] 10.73035 0.05638691 [42,] 10.72962 0.05624282 [43,] 10.72888 0.05609635 [44,] 10.72814 0.05594744 [45,] 10.72740 0.05579606 [46,] 10.72665 0.05564216 [47,] 10.72590 0.05548568 [48,] 10.72514 0.05532658 [49,] 10.72438 0.05516480 [50,] 10.72361 0.05500029 [51,] 10.72284 0.05483300 [52,] 10.72207 0.05466286 [53,] 10.72129 0.05448983 [54,] 10.72051 0.05431383 [55,] 10.71972 0.05413482 [56,] 10.71893 0.05395272 [57,] 10.71813 0.05376747 [58,] 10.71813 0.05357900 [59,] 10.71733 0.05338725 [60,] 10.71652 0.05319214 [61,] 10.71490 0.05299359 [62,] 10.71552 0.05290050 [63,] 10.71614 0.05280571 [64,] 10.71676 0.05270919 [65,] 10.71739 0.05261091 [66,] 10.71802 0.05251085 [67,] 10.71866 0.05240896 [68,] 10.71930 0.05230521 [69,] 10.71994 0.05219956 [70,] 10.72059 0.05209198 [71,] 10.72124 0.05198244 [72,] 10.72189 0.05187089 [73,] 10.72255 0.05175730 [74,] 10.72321 0.05164162 [75,] 10.72388 0.05152382 [76,] 10.72455 0.05140385 [77,] 10.72523 0.05128167 [78,] 10.72590 0.05115723 [79,] 10.72659 0.05103049 [80,] 10.72727 0.05090140 [81,] 10.72796 0.05076992 [82,] 10.72866 0.05063599 [83,] 10.72936 0.05049957 [84,] 10.73006 0.05036060 [85,] 10.73077 0.05021902 [86,] 10.73148 0.05007479 [87,] 10.73220 0.04992784 [88,] 10.73447 0.04986373 [89,] 10.73676 0.04979808 [90,] 10.73906 0.04973087 [91,] 10.74138 0.04966207 [92,] 10.74371 0.04959163 [93,] 10.74606 0.04951953 [94,] 10.74842 0.04944572 [95,] 10.75079 0.04937019 [96,] 10.75318 0.04929288 [97,] 10.75559 0.04921377 [98,] 10.75801 0.04913280 [99,] 10.76045 0.04904996 [100,] 10.76290 0.04896518 [101,] 10.76537 0.04887844 [102,] 10.76786 0.04878969 [103,] 10.77036 0.04869888 [104,] 10.77288 0.04860598 [105,] 10.77541 0.04851093 [106,] 10.77796 0.04841368 [107,] 10.78053 0.04831419 [108,] 10.78311 0.04821241 [109,] 10.78571 0.04810829 [110,] 10.78833 0.04800176 [111,] 10.79097 0.04789278 [112,] 10.79362 0.04778129 [113,] 10.79630 0.04766723 [114,] 10.79899 0.04755054 [115,] 10.80169 0.04743116 [116,] 10.80169 0.04730902 [117,] 10.80442 0.04718405 [118,] 10.80717 0.04705620 [119,] 10.80993 0.04692539 [120,] 10.81271 0.04679154 [121,] 10.81834 0.04665457 [122,] 10.81944 0.04666480 [123,] 10.82056 0.04667455 [124,] 10.82168 0.04668381 [125,] 10.82281 0.04669259 [126,] 10.82394 0.04670085 [127,] 10.82509 0.04670860 [128,] 10.82624 0.04671582 [129,] 10.82740 0.04672250 [130,] 10.82857 0.04672862 [131,] 10.82975 0.04673418 [132,] 10.83094 0.04673915 [133,] 10.83213 0.04674353 [134,] 10.83333 0.04674731 [135,] 10.83455 0.04675046 [136,] 10.83577 0.04675298 [137,] 10.83700 0.04675485 [138,] 10.83824 0.04675605 [139,] 10.83948 0.04675657 [140,] 10.84074 0.04675639 [141,] 10.84201 0.04675550 [142,] 10.84328 0.04675388 [143,] 10.84457 0.04675151 [144,] 10.84586 0.04674837 [145,] 10.84717 0.04674445 [146,] 10.84848 0.04673973 [147,] 10.84981 0.04673419 [148,] 10.85115 0.04672781 [149,] 10.85249 0.04672057 [150,] 10.85385 0.04671244 [151,] 10.85521 0.04670342 [152,] 10.85659 0.04669347 [153,] 10.85798 0.04668257 [154,] 10.85938 0.04667071 [155,] 10.86078 0.04665785 [156,] 10.86220 0.04664397 [157,] 10.86364 0.04662906 [158,] 10.86508 0.04661307 [159,] 10.86653 0.04659599 [160,] 10.86800 0.04657779 [161,] 10.86948 0.04655845 [162,] 10.87097 0.04653793 [163,] 10.87247 0.04651620 [164,] 10.87398 0.04649323 [165,] 10.87551 0.04646900 [166,] 10.87705 0.04644347 [167,] 10.87860 0.04641660 [168,] 10.88017 0.04638837 [169,] 10.88174 0.04635874 [170,] 10.88333 0.04632768 [171,] 10.88494 0.04629514 [172,] 10.88655 0.04626109 [173,] 10.88819 0.04622549 [174,] 10.88983 0.04618829 [175,] 10.89149 0.04614947 [176,] 10.89316 0.04610897 [177,] 10.89485 0.04606675 [178,] 10.89655 0.04602276 [179,] 10.89827 0.04597696 [180,] 10.90000 0.04592930 [181,] 10.90175 0.04587973 [182,] 10.90351 0.04582820 [183,] 10.90529 0.04577464 [184,] 10.90708 0.04571902 [185,] 10.90889 0.04566127 [186,] 10.91071 0.04560133 [187,] 10.91256 0.04553914 [188,] 10.91441 0.04547464 [189,] 10.91629 0.04540776 [190,] 10.91591 0.04549995 [191,] 10.91553 0.04559269 [192,] 10.91514 0.04568598 [193,] 10.91475 0.04577983 [194,] 10.91435 0.04587424 [195,] 10.91395 0.04596922 [196,] 10.91355 0.04606477 [197,] 10.91315 0.04616089 [198,] 10.91274 0.04625760 [199,] 10.91232 0.04635490 [200,] 10.91190 0.04645279 [201,] 10.91148 0.04655128 [202,] 10.91106 0.04665038 [203,] 10.91063 0.04675009 [204,] 10.91019 0.04685041 [205,] 10.90976 0.04695136 [206,] 10.90931 0.04705295 [207,] 10.90887 0.04715516 [208,] 10.90842 0.04725802 [209,] 10.90796 0.04736153 [210,] 10.90750 0.04746569 [211,] 10.90704 0.04757052 [212,] 10.90657 0.04767601 [213,] 10.90609 0.04778217 [214,] 10.90561 0.04788902 [215,] 10.90513 0.04799656 [216,] 10.90464 0.04810479 [217,] 10.90415 0.04821373 [218,] 10.90365 0.04832337 [219,] 10.90314 0.04843373 [220,] 10.90263 0.04854481 [221,] 10.90212 0.04865663 [222,] 10.90160 0.04876918 [223,] 10.90107 0.04888248 [224,] 10.90054 0.04899653 [225,] 10.90000 0.04911134 [226,] 10.89946 0.04922693 [227,] 10.89891 0.04934329 [228,] 10.89835 0.04946043 [229,] 10.89779 0.04957837 [230,] 10.89722 0.04969710 [231,] 10.89722 0.04981665 [232,] 10.89665 0.04993701 [233,] 10.89607 0.05005821 [234,] 10.89548 0.05018023 [235,] 10.89489 0.05030310 [236,] 10.89429 0.05042682 [237,] 10.89368 0.05055140 [238,] 10.89306 0.05067685 [239,] 10.89244 0.05080318 [240,] 10.89181 0.05093040 [241,] 10.89053 0.05105851 [242,] 10.88988 0.05118753 [243,] 10.88922 0.05131747 [244,] 10.88855 0.05144833 [245,] 10.88788 0.05158013 [246,] 10.88720 0.05171287 [247,] 10.88650 0.05184656 [248,] 10.88580 0.05198122 [249,] 10.88509 0.05211686 [250,] 10.88438 0.05225348 [251,] 10.88365 0.05239109 [252,] 10.88291 0.05252971 [253,] 10.88217 0.05266934 [254,] 10.88141 0.05281000 [255,] 10.88065 0.05295170 [256,] 10.87987 0.05309444 [257,] 10.87908 0.05323824 [258,] 10.87829 0.05338310 [259,] 10.87748 0.05352905 [260,] 10.87667 0.05367609 [261,] 10.87584 0.05382422 [262,] 10.87500 0.05397347 [263,] 10.87415 0.05412384 [264,] 10.87329 0.05427535 [265,] 10.87241 0.05442800 [266,] 10.87153 0.05458180 [267,] 10.87063 0.05473677 [268,] 10.86972 0.05489292 [269,] 10.86879 0.05505026 [270,] 10.86786 0.05520881 [271,] 10.86691 0.05536856 [272,] 10.86594 0.05552953 [273,] 10.86496 0.05569174 > (midr <- midrange(x)) [1] 38.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/1qita1218456962.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/221nm1218456962.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/3hm4g1218456963.tab") > > system("convert tmp/1qita1218456962.ps tmp/1qita1218456962.png") > system("convert tmp/221nm1218456962.ps tmp/221nm1218456962.png") > > > proc.time() user system elapsed 9.409 0.450 10.061