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(9.913463687 + ,9.913463687 + ,9.723463687 + ,9.553463687 + ,10.22346369 + ,13.35346369 + ,13.32346369 + ,12.93346369 + ,12.18346369 + ,11.57346369 + ,11.04346369 + ,10.45346369 + ,9.703463687 + ,9.453463687 + ,9.033463687 + ,8.653463687 + ,8.293463687 + ,7.953463687 + ,7.633463687 + ,7.303463687 + ,6.573463687 + ,5.463463687 + ,4.583463687 + ,3.823463687 + ,3.113463687 + ,1.493463687 + ,-7.896536313 + ,-8.596536313 + ,-7.306536313 + ,-3.416536313 + ,-1.566536313 + ,0.423463687 + ,4.203463687 + ,5.703463687 + ,6.973463687 + ,7.733463687 + ,7.883463687 + ,6.893463687 + ,6.263463687 + ,9.073463687 + ,7.933463687 + ,6.733463687 + ,5.993463687 + ,5.113463687 + ,4.213463687 + ,3.103463687 + ,1.973463687 + ,4.763463687 + ,4.323463687 + ,3.333463687 + ,2.513463687 + ,1.793463687 + ,1.013463687 + ,0.053463687 + ,-0.896536313 + ,-1.906536313 + ,-2.886536313 + ,0.903463687 + ,3.333463687 + ,2.543463687 + ,1.383463687 + ,0.413463687 + ,3.773463687 + ,3.713463687 + ,2.663463687 + ,1.543463687 + ,0.643463687 + ,-0.466536313 + ,-1.396536313 + ,4.563463687 + ,2.903463687 + ,1.303463687 + ,0.053463687 + ,-1.206536313 + ,-2.666536313 + ,-0.976536313 + ,-1.326536313 + ,-2.716536313 + ,-4.076536313 + ,-5.576536313 + ,-2.976536313 + ,-2.456536313 + ,-2.826536313 + ,-4.286536313 + ,-4.616536313 + ,-6.046536313 + ,-6.986536313 + ,-7.016536313 + ,-7.356536313 + ,-8.006536313 + ,-9.596536313 + ,-8.106536313 + ,-7.566536313 + ,-8.986536313 + ,-9.746536313 + ,-8.976536313 + ,-10.41653631 + ,-12.15653631 + ,-10.72653631 + ,-13.91653631 + ,-16.70653631 + ,-15.02653631 + ,-17.04653631 + ,-18.72653631 + ,-16.90653631 + ,-18.77653631 + ,-15.49653631 + ,-15.51653631 + ,-9.926536313 + ,-0.306536313 + ,14.37346369 + ,15.78346369 + ,16.78346369 + ,15.74346369 + ,14.14346369 + ,12.59346369 + ,10.79346369 + ,9.613463687 + ,10.66346369 + ,8.873463687 + ,7.283463687 + ,5.863463687 + ,4.333463687 + ,2.883463687 + ,1.433463687 + ,0.143463687 + ,-1.166536313 + ,-2.326536313 + ,-3.366536313 + ,-1.876536313 + ,-0.226536313 + ,-1.216536313 + ,-1.096536313 + ,0.823463687 + ,-0.876536313 + ,-0.056536313 + ,-0.716536313 + ,-2.376536313 + ,-3.856536313 + ,-5.296536313 + ,-6.776536313 + ,-5.406536313 + ,-1.076536313 + ,-2.506536313 + ,-2.436536313 + ,-5.466536313 + ,-6.356536313 + ,0.103463687 + ,-1.586536313 + ,-0.766536313 + ,-1.296536313 + ,-2.796536313 + ,-4.346536313 + ,-4.716536313 + ,-4.206536313 + ,-5.836536313 + ,-7.586536313 + ,-9.386536313 + ,-7.406536313 + ,-5.206536313 + ,-6.896536313 + ,-8.506536313 + ,-9.996536313 + ,-11.49653631 + ,-5.206536313 + ,-6.026536313 + ,-7.436536313 + ,-8.926536313 + ,-10.20653631 + ,-11.35653631 + ,-10.11653631 + ,-6.456536313 + ,-7.616536313 + ,-8.776536313 + ,-9.886536313 + ,-11.05653631 + ,-12.55653631 + ,-10.78653631 + ,-11.39653631 + ,-12.66653631 + ,-12.66653631 + ,-16.42653631 + ,-18.28653631 + ,-18.94653631 + ,-19.59653631 + ,-20.25653631 + ,-24.05653631 + ,-27.40653631 + ,-27.96653631 + ,-28.52653631 + ,-29.06653631 + ,-29.62653631 + ,-30.12653631 + ,-30.60653631 + ,-31.07653631 + ,-28.46653631 + ,-28.13653631 + ,-28.83653631 + ,-29.33653631 + ,-23.02653631 + ,-23.57653631 + ,-24.12653631 + ,-24.40653631 + ,-25.19653631 + ,-25.66653631 + ,-18.81653631 + ,0.833463687 + ,-0.336536313 + ,-1.176536313 + ,-0.216536313 + ,-1.496536313 + ,18.10346369 + ,32.30346369 + ,34.91346369 + ,34.64346369 + ,30.56346369 + ,28.59346369 + ,27.69346369 + ,25.61346369 + ,24.83346369 + ,27.86346369 + ,24.48346369 + ,22.52346369 + ,18.86346369 + ,17.39346369 + ,14.14346369 + ,14.26346369 + ,14.17346369 + ,7.863463687 + ,10.46346369 + ,10.01346369 + ,7.073463687 + ,7.823463687 + ,6.663463687 + ,9.363463687 + ,25.15346369 + ,27.08346369 + ,29.61346369 + ,29.65346369 + ,21.89346369 + ,17.08346369 + ,36.07346369 + ,79.96346369 + ,70.01346369 + ,94.52346369 + ,94.58346369 + ,55.34346369 + ,48.65346369 + ,43.81346369 + ,38.08346369 + ,33.11346369 + ,40.48346369 + ,40.26346369 + ,47.28346369 + ,32.22346369 + ,33.90346369 + ,22.41346369 + ,20.84346369 + ,21.83346369 + ,20.60346369 + ,12.18346369 + ,10.54346369 + ,15.97346369 + ,17.05346369 + ,15.83346369 + ,12.92346369 + ,14.09346369 + ,12.61346369 + ,10.98346369 + ,11.04346369 + ,5.073463687 + ,2.523463687 + ,-1.676536313 + ,-1.706536313 + ,7.133463687 + ,19.36346369 + ,10.11346369 + ,5.023463687 + ,6.113463687 + ,1.943463687 + ,0.793463687 + ,-4.596536313 + ,-4.916536313 + ,-8.906536313 + ,-9.746536313 + ,-8.606536313 + ,-7.296536313 + ,-8.816536313 + ,-12.06653631 + ,-18.40653631 + ,-18.19653631 + ,-14.99653631 + ,-11.08653631 + ,-21.74653631 + ,-22.13653631 + ,-21.51653631 + ,-20.61653631 + ,-26.47653631 + ,-23.48653631 + ,-24.41653631 + ,-22.28653631 + ,-23.75653631 + ,-18.58653631 + ,-15.51653631 + ,-21.45653631 + ,-24.04653631 + ,-30.95653631 + ,-32.79653631 + ,-27.36653631 + ,-27.36653631 + ,-24.00653631 + ,-31.13653631 + ,-26.91653631 + ,-28.29653631 + ,-31.51653631 + ,-28.91653631 + ,-27.40653631 + ,-30.83653631 + ,-26.85653631 + ,-29.78653631 + ,-29.31653631 + ,-30.52653631 + ,-29.69653631 + ,-28.20653631 + ,-21.82653631 + ,-21.54653631 + ,-19.14653631 + ,-21.17653631 + ,-19.59653631 + ,-14.17653631 + ,-22.60653631 + ,-21.62653631 + ,-14.82653631 + ,-15.97653631 + ,-7.766536313 + ,1.863463687 + ,2.633463687 + ,16.31346369 + ,30.26346369 + ,22.81346369 + ,19.93346369 + ,13.08346369 + ,3.273463687 + ,3.213463687 + ,-1.546536313 + ,8.223463687 + ,11.98346369 + ,12.05346369 + ,27.36346369 + ,17.95346369 + ,11.90346369 + ,13.07346369 + ,9.603463687 + ,2.613463687 + ,3.853463687 + ,9.983463687 + ,6.273463687 + ,4.853463687 + ,17.03346369 + ,24.81346369) > 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] 0.1716304 > sqrtn <- sqrt(length(x)) > (armse <- sd(x) / sqrtn) [1] 0.993561 > (armose <- arm / armse) [1] 0.1727426 > (geo <- geomean(x)) [1] NaN Warning message: In log(x) : NaNs produced > (har <- harmean(x)) [1] 18.93143 > (qua <- quamean(x)) [1] 18.82608 > (win <- winmean(x)) [,1] [,2] [1,] 0.17501924 0.9931945 [2,] 0.09624147 0.9730424 [3,] 0.01382480 0.9550449 [4,] -0.14784187 0.9246096 [5,] -0.23909187 0.9097259 [6,] -0.25809187 0.9059895 [7,] -0.32400853 0.8962834 [8,] -0.38911964 0.8856167 [9,] -0.38611964 0.8841198 [10,] -0.44417520 0.8763012 [11,] -0.50345298 0.8687390 [12,] -0.53245298 0.8633599 [13,] -0.54148076 0.8621811 [14,] -0.56053631 0.8580337 [15,] -0.58720298 0.8538046 [16,] -0.61964742 0.8495536 [17,] -0.60878631 0.8477974 [18,] -0.68878631 0.8387364 [19,] -0.69564742 0.8362721 [20,] -0.72453631 0.8323423 [21,] -0.72278631 0.8317299 [22,] -0.77473076 0.8245168 [23,] -0.78559187 0.8166565 [24,] -0.79692520 0.8155513 [25,] -0.81706409 0.8130775 [26,] -0.83728631 0.8111319 [27,] -0.91378631 0.7976686 [28,] -0.94489742 0.7939494 [29,] -0.94006409 0.7888246 [30,] -0.87423076 0.7826509 [31,] -0.86217520 0.7765079 [32,] -0.94128631 0.7572505 [33,] -0.96695298 0.7548577 [34,] -0.95089742 0.7516784 [35,] -0.99464742 0.7467466 [36,] -0.99964742 0.7461487 [37,] -1.09728631 0.7372392 [38,] -1.09623076 0.7328659 [39,] -1.14931409 0.7252541 [40,] -1.20264742 0.7193056 [41,] -1.20720298 0.7102948 [42,] -1.24686964 0.6992059 [43,] -1.22656409 0.6945859 [44,] -1.27667520 0.6878173 [45,] -1.27667520 0.6816347 [46,] -1.27028631 0.6804896 [47,] -1.25723076 0.6789825 [48,] -1.27989742 0.6755993 [49,] -1.33978631 0.6705295 [50,] -1.37867520 0.6663864 [51,] -1.35884187 0.6616300 [52,] -1.28517520 0.6544036 [53,] -1.23806409 0.6496336 [54,] -1.34456409 0.6269194 [55,] -1.36136964 0.6257481 [56,] -1.30536964 0.6191231 [57,] -1.27845298 0.6162567 [58,] -1.25750853 0.6145869 [59,] -1.25914742 0.6134938 [60,] -1.37414742 0.6043436 [61,] -1.35550853 0.6021043 [62,] -1.36584187 0.5968388 [63,] -1.34659187 0.5950530 [64,] -1.35548076 0.5921083 [65,] -1.14964742 0.5757730 [66,] -1.18081409 0.5699491 [67,] -1.14731409 0.5668446 [68,] -1.17186964 0.5576091 [69,] -1.08561964 0.5510766 [70,] -1.02145298 0.5426869 [71,] -1.03525853 0.5417616 [72,] -1.04725853 0.5403941 [73,] -1.01886964 0.5288762 [74,] -1.12164742 0.5212658 [75,] -1.08623076 0.5186460 [76,] -0.96167520 0.5077806 [77,] -0.94670298 0.5011025 [78,] -0.70403631 0.4800849 [79,] -0.73036964 0.4783521 [80,] -0.72370298 0.4754893 [81,] -0.63595298 0.4691437 [82,] -0.66784187 0.4643053 [83,] -0.56178631 0.4537405 [84,] -0.56178631 0.4506488 [85,] -0.55942520 0.4495537 [86,] -0.51164742 0.4441644 [87,] -0.50439742 0.4436839 [88,] -0.48484187 0.4362947 [89,] -0.47495298 0.4349978 [90,] -0.41995298 0.4284684 [91,] -0.36939742 0.4248666 [92,] -0.35917520 0.4225500 [93,] -0.35400854 0.4188726 [94,] -0.35923076 0.4161704 [95,] -0.42520298 0.4105373 [96,] -0.39853631 0.4074584 [97,] -0.44164742 0.4046864 [98,] -0.46070298 0.3982452 [99,] -0.50195298 0.3882802 [100,] -0.41028631 0.3800176 [101,] -0.48323076 0.3750707 [102,] -0.47473076 0.3738228 [103,] -0.48331409 0.3725668 [104,] -0.46309187 0.3705703 [105,] -0.46309187 0.3691082 [106,] -0.43953631 0.3643185 [107,] -0.46628631 0.3622786 [108,] -0.53828631 0.3544558 [109,] -0.42323076 0.3465494 [110,] -0.43850854 0.3418301 [111,] -0.42309187 0.3386004 [112,] -0.41375854 0.3342007 [113,] -0.39178631 0.3297756 [114,] -0.43295298 0.3260857 [115,] -0.44892520 0.3243278 [116,] -0.43603631 0.3200006 [117,] -0.52378631 0.3134862 [118,] -0.51067520 0.3122867 [119,] -0.54373076 0.3082878 [120,] -0.58039742 0.3056828 > (tri <- trimean(x)) [,1] [,2] [1,] 1.324022e-09 0.9591192 [2,] -1.769857e-01 0.9228459 [3,] -3.159148e-01 0.8956495 [4,] -4.283261e-01 0.8738505 [5,] -5.004506e-01 0.8598082 [6,] -5.545248e-01 0.8486263 [7,] -6.059294e-01 0.8377254 [8,] -6.480770e-01 0.8280490 [9,] -6.821503e-01 0.8196087 [10,] -7.169775e-01 0.8110474 [11,] -7.460334e-01 0.8031345 [12,] -7.696613e-01 0.7957905 [13,] -7.696613e-01 0.7887421 [14,] -8.117773e-01 0.7815444 [15,] -8.313545e-01 0.7744641 [16,] -8.492192e-01 0.7674925 [17,] -8.650639e-01 0.7606169 [18,] -8.818141e-01 0.7536176 [19,] -8.938034e-01 0.7470603 [20,] -9.055363e-01 0.7404334 [21,] -9.157816e-01 0.7338340 [22,] -9.262515e-01 0.7270170 [23,] -9.341478e-01 0.7204255 [24,] -9.416004e-01 0.7140938 [25,] -9.486008e-01 0.7075802 [26,] -9.486008e-01 0.7009604 [27,] -9.600657e-01 0.6941917 [28,] -9.620955e-01 0.6879635 [29,] -9.628277e-01 0.6816998 [30,] -9.637696e-01 0.6754749 [31,] -9.673752e-01 0.6693424 [32,] -9.715025e-01 0.6632973 [33,] -9.726588e-01 0.6580513 [34,] -9.728719e-01 0.6527130 [35,] -9.736742e-01 0.6473166 [36,] -9.729252e-01 0.6419474 [37,] -9.719909e-01 0.6363785 [38,] -9.676983e-01 0.6310218 [39,] -9.633803e-01 0.6256524 [40,] -9.572506e-01 0.6204251 [41,] -9.493061e-01 0.6152576 [42,] -9.411015e-01 0.6102984 [43,] -9.315363e-01 0.6056462 [44,] -9.224554e-01 0.6010042 [45,] -9.117215e-01 0.5964657 [46,] -9.008274e-01 0.5920069 [47,] -8.899574e-01 0.5873961 [48,] -8.793015e-01 0.5826417 [49,] -8.793015e-01 0.5778190 [50,] -8.544979e-01 0.5729967 [51,] -8.398696e-01 0.5681305 [52,] -8.398696e-01 0.5632498 [53,] -8.130324e-01 0.5584690 [54,] -8.015760e-01 0.5536756 [55,] -7.870963e-01 0.5496510 [56,] -7.719395e-01 0.5454761 [57,] -7.579997e-01 0.5413900 [58,] -7.445281e-01 0.5372266 [59,] -7.313710e-01 0.5329272 [60,] -7.179530e-01 0.5284558 [61,] -7.014103e-01 0.5241447 [62,] -6.850533e-01 0.5197098 [63,] -6.850533e-01 0.5152735 [64,] -6.514501e-01 0.5106833 [65,] -6.342320e-01 0.5059774 [66,] -6.217118e-01 0.5017744 [67,] -6.082177e-01 0.4975968 [68,] -5.952863e-01 0.4933315 [69,] -5.815363e-01 0.4892374 [70,] -5.695818e-01 0.4852144 [71,] -5.589216e-01 0.4813432 [72,] -5.477400e-01 0.4772904 [73,] -5.360690e-01 0.4730644 [74,] -5.248382e-01 0.4691157 [75,] -5.110125e-01 0.4652630 [76,] -4.977382e-01 0.4613040 [77,] -4.870703e-01 0.4576144 [78,] -4.765363e-01 0.4540034 [79,] -4.713383e-01 0.4511260 [80,] -4.654363e-01 0.4481409 [81,] -4.595666e-01 0.4450933 [82,] -4.555669e-01 0.4421383 [83,] -4.507631e-01 0.4392058 [84,] -4.482551e-01 0.4365566 [85,] -4.456942e-01 0.4338663 [86,] -4.431321e-01 0.4310419 [87,] -4.415901e-01 0.4282709 [88,] -4.401776e-01 0.4253294 [89,] -4.391737e-01 0.4225265 [90,] -4.383696e-01 0.4195852 [91,] -4.387835e-01 0.4167426 [92,] -4.403431e-01 0.4138640 [93,] -4.421685e-01 0.4108853 [94,] -4.441526e-01 0.4078655 [95,] -4.460657e-01 0.4047536 [96,] -4.465363e-01 0.4016896 [97,] -4.476207e-01 0.3985462 [98,] -4.476207e-01 0.3953024 [99,] -4.474622e-01 0.3921395 [100,] -4.462238e-01 0.3892425 [101,] -4.470426e-01 0.3865381 [102,] -4.462158e-01 0.3838653 [103,] -4.455623e-01 0.3810316 [104,] -4.455623e-01 0.3780240 [105,] -4.442696e-01 0.3748692 [106,] -4.438336e-01 0.3715247 [107,] -4.439336e-01 0.3681649 [108,] -4.434113e-01 0.3646284 [109,] -4.434113e-01 0.3612400 [110,] -4.416077e-01 0.3580186 [111,] -4.416812e-01 0.3547833 [112,] -4.421245e-01 0.3514418 [113,] -4.428050e-01 0.3480576 [114,] -4.440363e-01 0.3446282 [115,] -4.440363e-01 0.3411034 [116,] -4.441926e-01 0.3373458 [117,] -4.443935e-01 0.3335074 [118,] -4.424234e-01 0.3297300 [119,] -4.407166e-01 0.3256471 [120,] -4.381196e-01 0.3214283 > (midr <- midrange(x)) [1] 30.89346 > midm <- array(NA,dim=8) > for (j in 1:8) midm[j] <- midmean(x,j) > midm [1] -0.4952103 -0.4383696 -0.4952103 -0.4383696 -0.4383696 -0.4952103 -0.4383696 [8] -0.4391737 > postscript(file="/var/www/html/rcomp/tmp/15zf31256053015.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/2yz741256053015.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/3neq91256053015.tab") > > system("convert tmp/15zf31256053015.ps tmp/15zf31256053015.png") > system("convert tmp/2yz741256053015.ps tmp/2yz741256053015.png") > > > proc.time() user system elapsed 2.092 0.334 2.248