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(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 + ,18 + ,12 + ,11 + ,13 + ,10 + ,10 + ,10 + ,8 + ,12 + ,10 + ,10 + ,8 + ,14 + ,9 + ,8 + ,12 + ,15 + ,14 + ,1 + ,9 + ,7 + ,8 + ,12 + ,57 + ,12 + ,10 + ,10 + ,8 + ,8 + ,16 + ,14 + ,13 + ,10 + ,12 + ,9 + ,12 + ,11 + ,10 + ,8 + ,8 + ,9 + ,12 + ,8 + ,12 + ,10 + ,12 + ,9 + ,8 + ,12 + ,8 + ,12 + ,10 + ,12 + ,9 + ,28 + ,10 + ,12 + ,9 + ,14 + ,12 + ,12 + ,99 + ,13 + ,13 + ,14 + ,12 + ,12 + ,10 + ,11 + ,12 + ,14 + ,10 + ,12 + ,12 + ,6 + ,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 + ,6 + ,16 + ,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 + ,4 + ,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 + ,6 + ,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 + ,16 + ,10 + ,9 + ,12 + ,12 + ,10 + ,7 + ,12 + ,10 + ,10 + ,6 + ,9 + ,6 + ,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 + ,5 + ,9 + ,8 + ,13 + ,10 + ,10 + ,14 + ,10 + ,99 + ,10 + ,12 + ,17 + ,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 + ,16 + ,12 + ,10 + ,10 + ,99 + ,8 + ,11 + ,12 + ,12 + ,11 + ,10 + ,20 + ,9 + ,14 + ,12 + ,10 + ,12 + ,10 + ,12 + ,12 + ,8 + ,12 + ,12 + ,10 + ,99 + ,12 + ,2 + ,10 + ,10 + ,10 + ,12 + ,12 + ,12 + ,12 + ,88 + ,9 + ,12 + ,14 + ,8 + ,12 + ,10 + ,10 + ,10 + ,7 + ,8 + ,10 + ,1 + ,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 + ,1 + ,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 + ,6 + ,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 + ,50 + ,9 + ,12 + ,12 + ,7 + ,10 + ,8 + ,10 + ,10 + ,10 + ,8 + ,12 + ,7 + ,13 + ,13 + ,8 + ,8 + ,11 + ,6 + ,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 + ,99 + ,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 + ,99 + ,8 + ,99 + ,12 + ,99 + ,12 + ,10 + ,12 + ,10 + ,12 + ,12 + ,12 + ,10 + ,12 + ,12 + ,10 + ,10 + ,12 + ,99 + ,12 + ,12 + ,9 + ,99 + ,12 + ,12 + ,9 + ,12 + ,12 + ,12 + ,15 + ,12 + ,12 + ,12 + ,8 + ,8 + ,12 + ,8 + ,12 + ,12 + ,10 + ,10 + ,12 + ,99 + ,8 + ,8 + ,99 + ,10 + ,10 + ,5 + ,9 + ,9 + ,99 + ,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] 12.32051 > sqrtn <- sqrt(length(x)) > (armse <- sd(x) / sqrtn) [1] 0.3977598 > (armose <- arm / armse) [1] 30.97476 > (geo <- geomean(x)) [1] 10.91180 > (har <- harmean(x)) [1] 10.15246 > (qua <- quamean(x)) [1] 16.95239 > (win <- winmean(x)) [,1] [,2] [1,] 12.32051 0.39775979 [2,] 12.32051 0.39775979 [3,] 12.32401 0.39764877 [4,] 12.33333 0.39739345 [5,] 12.33916 0.39725934 [6,] 12.33916 0.39725934 [7,] 12.34732 0.39709532 [8,] 12.34732 0.39709532 [9,] 12.34732 0.39709532 [10,] 12.34732 0.39709532 [11,] 12.34732 0.39709532 [12,] 12.34732 0.39709532 [13,] 12.18065 0.35508822 [14,] 11.90326 0.28281023 [15,] 11.67599 0.22924853 [16,] 11.54545 0.19948420 [17,] 11.10956 0.10790610 [18,] 10.94172 0.08100624 [19,] 10.89744 0.07567584 [20,] 10.89744 0.07567584 [21,] 10.87296 0.07313687 [22,] 10.87296 0.07313687 [23,] 10.84615 0.07068338 [24,] 10.84615 0.07068338 [25,] 10.84615 0.07068338 [26,] 10.84615 0.07068338 [27,] 10.81469 0.06821446 [28,] 10.81469 0.06821446 [29,] 10.81469 0.06821446 [30,] 10.81469 0.06821446 [31,] 10.81469 0.06821446 [32,] 10.81469 0.06821446 [33,] 10.81469 0.06821446 [34,] 10.81469 0.06821446 [35,] 10.81469 0.06821446 [36,] 10.81469 0.06821446 [37,] 10.85781 0.06570737 [38,] 10.85781 0.06570737 [39,] 10.85781 0.06570737 [40,] 10.85781 0.06570737 [41,] 10.85781 0.06570737 [42,] 10.85781 0.06570737 [43,] 10.85781 0.06570737 [44,] 10.85781 0.06570737 [45,] 10.85781 0.06570737 [46,] 10.85781 0.06570737 [47,] 10.80303 0.06203504 [48,] 10.80303 0.06203504 [49,] 10.80303 0.06203504 [50,] 10.80303 0.06203504 [51,] 10.80303 0.06203504 [52,] 10.80303 0.06203504 [53,] 10.80303 0.06203504 [54,] 10.80303 0.06203504 [55,] 10.80303 0.06203504 [56,] 10.80303 0.06203504 [57,] 10.80303 0.06203504 [58,] 10.80303 0.06203504 [59,] 10.80303 0.06203504 [60,] 10.80303 0.06203504 [61,] 10.80303 0.06203504 [62,] 10.80303 0.06203504 [63,] 10.80303 0.06203504 [64,] 10.80303 0.06203504 [65,] 10.80303 0.06203504 [66,] 10.80303 0.06203504 [67,] 10.80303 0.06203504 [68,] 10.80303 0.06203504 [69,] 10.80303 0.06203504 [70,] 10.80303 0.06203504 [71,] 10.80303 0.06203504 [72,] 10.80303 0.06203504 [73,] 10.80303 0.06203504 [74,] 10.80303 0.06203504 [75,] 10.80303 0.06203504 [76,] 10.80303 0.06203504 [77,] 10.80303 0.06203504 [78,] 10.80303 0.06203504 [79,] 10.80303 0.06203504 [80,] 10.80303 0.06203504 [81,] 10.80303 0.06203504 [82,] 10.80303 0.06203504 [83,] 10.80303 0.06203504 [84,] 10.80303 0.06203504 [85,] 10.70396 0.05668655 [86,] 10.70396 0.05668655 [87,] 10.70396 0.05668655 [88,] 10.70396 0.05668655 [89,] 10.70396 0.05668655 [90,] 10.70396 0.05668655 [91,] 10.70396 0.05668655 [92,] 10.70396 0.05668655 [93,] 10.70396 0.05668655 [94,] 10.70396 0.05668655 [95,] 10.70396 0.05668655 [96,] 10.70396 0.05668655 [97,] 10.70396 0.05668655 [98,] 10.70396 0.05668655 [99,] 10.70396 0.05668655 [100,] 10.70396 0.05668655 [101,] 10.70396 0.05668655 [102,] 10.70396 0.05668655 [103,] 10.70396 0.05668655 [104,] 10.70396 0.05668655 [105,] 10.70396 0.05668655 [106,] 10.70396 0.05668655 [107,] 10.70396 0.05668655 [108,] 10.70396 0.05668655 [109,] 10.70396 0.05668655 [110,] 10.70396 0.05668655 [111,] 10.57459 0.05149354 [112,] 10.57459 0.05149354 [113,] 10.57459 0.05149354 [114,] 10.57459 0.05149354 [115,] 10.57459 0.05149354 [116,] 10.57459 0.05149354 [117,] 10.57459 0.05149354 [118,] 10.57459 0.05149354 [119,] 10.57459 0.05149354 [120,] 10.57459 0.05149354 [121,] 10.57459 0.05149354 [122,] 10.57459 0.05149354 [123,] 10.57459 0.05149354 [124,] 10.57459 0.05149354 [125,] 10.57459 0.05149354 [126,] 10.57459 0.05149354 [127,] 10.57459 0.05149354 [128,] 10.57459 0.05149354 [129,] 10.57459 0.05149354 [130,] 10.57459 0.05149354 [131,] 10.57459 0.05149354 [132,] 10.57459 0.05149354 [133,] 10.57459 0.05149354 [134,] 10.57459 0.05149354 [135,] 10.73193 0.04313837 [136,] 10.73193 0.04313837 [137,] 10.73193 0.04313837 [138,] 10.73193 0.04313837 [139,] 10.73193 0.04313837 [140,] 10.73193 0.04313837 [141,] 10.73193 0.04313837 [142,] 10.73193 0.04313837 [143,] 10.73193 0.04313837 [144,] 10.73193 0.04313837 [145,] 10.73193 0.04313837 [146,] 10.73193 0.04313837 [147,] 10.73193 0.04313837 [148,] 10.73193 0.04313837 [149,] 10.73193 0.04313837 [150,] 10.73193 0.04313837 [151,] 10.73193 0.04313837 [152,] 10.73193 0.04313837 [153,] 10.73193 0.04313837 [154,] 10.73193 0.04313837 [155,] 10.73193 0.04313837 [156,] 10.73193 0.04313837 [157,] 10.73193 0.04313837 [158,] 10.73193 0.04313837 [159,] 10.73193 0.04313837 [160,] 10.73193 0.04313837 [161,] 10.73193 0.04313837 [162,] 10.73193 0.04313837 [163,] 10.73193 0.04313837 [164,] 10.73193 0.04313837 [165,] 10.73193 0.04313837 [166,] 10.73193 0.04313837 [167,] 10.73193 0.04313837 [168,] 10.73193 0.04313837 [169,] 10.73193 0.04313837 [170,] 10.73193 0.04313837 [171,] 10.73193 0.04313837 [172,] 10.73193 0.04313837 [173,] 10.73193 0.04313837 [174,] 10.73193 0.04313837 [175,] 10.73193 0.04313837 [176,] 10.73193 0.04313837 [177,] 10.73193 0.04313837 [178,] 10.73193 0.04313837 [179,] 10.73193 0.04313837 [180,] 10.73193 0.04313837 [181,] 10.73193 0.04313837 [182,] 10.73193 0.04313837 [183,] 10.73193 0.04313837 [184,] 10.73193 0.04313837 [185,] 10.73193 0.04313837 [186,] 10.73193 0.04313837 [187,] 10.73193 0.04313837 [188,] 10.73193 0.04313837 [189,] 10.73193 0.04313837 [190,] 10.73193 0.04313837 [191,] 10.73193 0.04313837 [192,] 10.73193 0.04313837 [193,] 10.73193 0.04313837 [194,] 10.73193 0.04313837 [195,] 10.73193 0.04313837 [196,] 10.73193 0.04313837 [197,] 10.73193 0.04313837 [198,] 10.73193 0.04313837 [199,] 10.73193 0.04313837 [200,] 10.73193 0.04313837 [201,] 10.73193 0.04313837 [202,] 10.73193 0.04313837 [203,] 10.96853 0.03339740 [204,] 10.96853 0.03339740 [205,] 10.96853 0.03339740 [206,] 10.96853 0.03339740 [207,] 10.96853 0.03339740 [208,] 10.96853 0.03339740 [209,] 10.96853 0.03339740 [210,] 10.96853 0.03339740 [211,] 10.96853 0.03339740 [212,] 10.96853 0.03339740 [213,] 10.96853 0.03339740 [214,] 10.96853 0.03339740 [215,] 10.96853 0.03339740 [216,] 10.96853 0.03339740 [217,] 10.96853 0.03339740 [218,] 10.96853 0.03339740 [219,] 10.96853 0.03339740 [220,] 10.96853 0.03339740 [221,] 10.96853 0.03339740 [222,] 10.96853 0.03339740 [223,] 10.96853 0.03339740 [224,] 10.96853 0.03339740 [225,] 10.96853 0.03339740 [226,] 10.96853 0.03339740 [227,] 10.96853 0.03339740 [228,] 10.96853 0.03339740 [229,] 10.96853 0.03339740 [230,] 10.96853 0.03339740 [231,] 10.96853 0.03339740 [232,] 10.96853 0.03339740 [233,] 10.96853 0.03339740 [234,] 10.96853 0.03339740 [235,] 10.96853 0.03339740 [236,] 10.96853 0.03339740 [237,] 10.96853 0.03339740 [238,] 10.96853 0.03339740 [239,] 10.96853 0.03339740 [240,] 10.96853 0.03339740 [241,] 10.96853 0.03339740 [242,] 10.96853 0.03339740 [243,] 10.96853 0.03339740 [244,] 10.96853 0.03339740 [245,] 10.96853 0.03339740 [246,] 10.96853 0.03339740 [247,] 10.96853 0.03339740 [248,] 10.96853 0.03339740 [249,] 10.96853 0.03339740 [250,] 10.96853 0.03339740 [251,] 10.96853 0.03339740 [252,] 10.96853 0.03339740 [253,] 10.96853 0.03339740 [254,] 10.96853 0.03339740 [255,] 10.96853 0.03339740 [256,] 10.96853 0.03339740 [257,] 10.96853 0.03339740 [258,] 10.96853 0.03339740 [259,] 10.96853 0.03339740 [260,] 10.96853 0.03339740 [261,] 10.96853 0.03339740 [262,] 10.96853 0.03339740 [263,] 10.96853 0.03339740 [264,] 10.96853 0.03339740 [265,] 10.96853 0.03339740 [266,] 10.96853 0.03339740 [267,] 10.96853 0.03339740 [268,] 10.96853 0.03339740 [269,] 10.96853 0.03339740 [270,] 10.96853 0.03339740 [271,] 10.96853 0.03339740 [272,] 10.96853 0.03339740 [273,] 10.96853 0.03339740 [274,] 10.96853 0.03339740 [275,] 10.96853 0.03339740 [276,] 10.96853 0.03339740 [277,] 10.96853 0.03339740 [278,] 10.96853 0.03339740 [279,] 10.96853 0.03339740 [280,] 10.96853 0.03339740 [281,] 10.96853 0.03339740 [282,] 10.96853 0.03339740 [283,] 10.96853 0.03339740 [284,] 10.96853 0.03339740 [285,] 10.96853 0.03339740 [286,] 10.96853 0.03339740 > (tri <- trimean(x)) [,1] [,2] [1,] 12.23248 0.38536151 [2,] 12.14403 0.37240164 [3,] 12.05516 0.35881743 [4,] 11.96471 0.34457509 [5,] 11.87146 0.32961777 [6,] 11.77660 0.31379379 [7,] 11.68128 0.29692727 [8,] 11.58432 0.27885720 [9,] 11.48690 0.25929526 [10,] 11.38902 0.23787039 [11,] 11.29067 0.21402012 [12,] 11.19185 0.18681352 [13,] 11.09255 0.15448209 [14,] 11.00602 0.12384288 [15,] 10.93961 0.10148887 [16,] 10.88862 0.08491603 [17,] 10.84587 0.07046695 [18,] 10.82968 0.06731662 [19,] 10.82317 0.06638195 [20,] 10.81907 0.06579657 [21,] 10.81495 0.06519938 [22,] 10.81204 0.06474626 [23,] 10.80911 0.06428487 [24,] 10.80741 0.06395095 [25,] 10.80569 0.06361149 [26,] 10.80397 0.06326635 [27,] 10.80224 0.06291539 [28,] 10.80175 0.06267528 [29,] 10.80125 0.06243142 [30,] 10.80075 0.06218375 [31,] 10.80075 0.06193216 [32,] 10.79975 0.06167660 [33,] 10.79924 0.06141696 [34,] 10.79873 0.06115317 [35,] 10.79822 0.06088513 [36,] 10.79771 0.06061274 [37,] 10.79719 0.06033592 [38,] 10.79540 0.06014435 [39,] 10.79359 0.05994973 [40,] 10.79177 0.05975198 [41,] 10.78995 0.05955105 [42,] 10.78811 0.05934688 [43,] 10.78627 0.05913939 [44,] 10.78442 0.05892852 [45,] 10.78255 0.05871420 [46,] 10.78068 0.05849635 [47,] 10.77880 0.05827491 [48,] 10.77822 0.05816026 [49,] 10.77763 0.05804377 [50,] 10.77704 0.05792539 [51,] 10.77646 0.05780510 [52,] 10.77586 0.05768285 [53,] 10.77527 0.05755861 [54,] 10.77467 0.05743236 [55,] 10.77467 0.05730404 [56,] 10.77346 0.05717363 [57,] 10.77285 0.05704109 [58,] 10.77224 0.05690637 [59,] 10.77162 0.05676945 [60,] 10.77100 0.05663027 [61,] 10.77100 0.05648879 [62,] 10.77038 0.05634497 [63,] 10.76913 0.05619877 [64,] 10.76849 0.05605015 [65,] 10.76786 0.05589904 [66,] 10.76722 0.05574542 [67,] 10.76657 0.05558922 [68,] 10.76593 0.05543040 [69,] 10.76528 0.05526890 [70,] 10.76462 0.05510468 [71,] 10.76397 0.05493767 [72,] 10.76331 0.05476782 [73,] 10.76264 0.05459507 [74,] 10.76197 0.05441937 [75,] 10.76130 0.05424065 [76,] 10.76062 0.05405884 [77,] 10.75994 0.05387389 [78,] 10.75926 0.05368572 [79,] 10.75857 0.05349426 [80,] 10.75788 0.05329945 [81,] 10.75718 0.05310121 [82,] 10.75648 0.05289947 [83,] 10.75578 0.05269414 [84,] 10.75507 0.05248514 [85,] 10.75436 0.05227240 [86,] 10.75510 0.05216794 [87,] 10.75585 0.05206158 [88,] 10.75660 0.05195328 [89,] 10.75735 0.05184300 [90,] 10.75811 0.05173071 [91,] 10.75888 0.05161636 [92,] 10.75964 0.05149992 [93,] 10.76042 0.05138135 [94,] 10.76119 0.05126060 [95,] 10.76198 0.05113762 [96,] 10.76276 0.05101239 [97,] 10.76355 0.05088484 [98,] 10.76435 0.05075493 [99,] 10.76515 0.05062261 [100,] 10.76596 0.05048784 [101,] 10.76677 0.05035056 [102,] 10.76758 0.05021071 [103,] 10.76840 0.05006826 [104,] 10.76923 0.04992313 [105,] 10.77006 0.04977527 [106,] 10.77090 0.04962462 [107,] 10.77174 0.04947113 [108,] 10.77259 0.04931472 [109,] 10.77344 0.04915534 [110,] 10.77344 0.04899291 [111,] 10.77516 0.04882737 [112,] 10.77760 0.04874681 [113,] 10.78006 0.04866440 [114,] 10.78254 0.04858011 [115,] 10.78503 0.04849389 [116,] 10.78754 0.04840571 [117,] 10.78754 0.04831552 [118,] 10.79260 0.04822327 [119,] 10.79516 0.04812893 [120,] 10.79773 0.04803244 [121,] 10.80032 0.04793376 [122,] 10.80032 0.04783284 [123,] 10.80556 0.04772963 [124,] 10.80556 0.04762408 [125,] 10.81086 0.04751613 [126,] 10.81353 0.04740574 [127,] 10.81623 0.04729283 [128,] 10.81894 0.04717737 [129,] 10.82167 0.04705927 [130,] 10.82441 0.04693849 [131,] 10.82718 0.04681496 [132,] 10.82997 0.04668862 [133,] 10.83277 0.04655939 [134,] 10.83559 0.04642720 [135,] 10.83844 0.04629199 [136,] 10.83959 0.04630136 [137,] 10.84075 0.04631026 [138,] 10.84192 0.04631869 [139,] 10.84310 0.04632663 [140,] 10.84429 0.04633407 [141,] 10.84549 0.04634100 [142,] 10.84669 0.04634741 [143,] 10.84790 0.04635329 [144,] 10.84912 0.04635862 [145,] 10.85035 0.04636339 [146,] 10.85159 0.04636759 [147,] 10.85284 0.04637121 [148,] 10.85409 0.04637422 [149,] 10.85536 0.04637663 [150,] 10.85663 0.04637842 [151,] 10.85791 0.04637956 [152,] 10.85921 0.04638005 [153,] 10.86051 0.04637987 [154,] 10.86182 0.04637901 [155,] 10.86314 0.04637744 [156,] 10.86447 0.04637517 [157,] 10.86581 0.04637215 [158,] 10.86716 0.04636839 [159,] 10.86852 0.04636386 [160,] 10.86989 0.04635855 [161,] 10.87127 0.04635243 [162,] 10.87266 0.04634549 [163,] 10.87406 0.04633771 [164,] 10.87547 0.04632906 [165,] 10.87689 0.04631954 [166,] 10.87833 0.04630911 [167,] 10.87977 0.04629776 [168,] 10.88123 0.04628546 [169,] 10.88269 0.04627219 [170,] 10.88417 0.04625793 [171,] 10.88566 0.04624265 [172,] 10.88716 0.04622634 [173,] 10.88867 0.04620895 [174,] 10.89020 0.04619048 [175,] 10.89173 0.04617089 [176,] 10.89328 0.04615015 [177,] 10.89484 0.04612824 [178,] 10.89641 0.04610513 [179,] 10.89800 0.04608079 [180,] 10.89960 0.04605518 [181,] 10.90121 0.04602828 [182,] 10.90283 0.04600005 [183,] 10.90447 0.04597047 [184,] 10.90612 0.04593948 [185,] 10.90779 0.04590708 [186,] 10.90947 0.04587320 [187,] 10.91116 0.04583782 [188,] 10.91286 0.04580090 [189,] 10.91458 0.04576240 [190,] 10.91632 0.04572228 [191,] 10.91807 0.04568050 [192,] 10.91983 0.04563700 [193,] 10.92161 0.04559176 [194,] 10.92340 0.04554471 [195,] 10.92521 0.04549582 [196,] 10.92704 0.04544504 [197,] 10.92888 0.04539230 [198,] 10.93074 0.04533757 [199,] 10.93261 0.04528079 [200,] 10.93450 0.04522190 [201,] 10.93640 0.04516084 [202,] 10.93833 0.04509755 [203,] 10.94027 0.04503198 [204,] 10.94000 0.04512240 [205,] 10.93973 0.04521335 [206,] 10.93946 0.04530485 [207,] 10.93919 0.04539689 [208,] 10.93891 0.04548948 [209,] 10.93864 0.04558263 [210,] 10.93836 0.04567633 [211,] 10.93807 0.04577061 [212,] 10.93779 0.04586546 [213,] 10.93750 0.04596088 [214,] 10.93721 0.04605689 [215,] 10.93692 0.04615349 [216,] 10.93662 0.04625068 [217,] 10.93632 0.04634848 [218,] 10.93602 0.04644688 [219,] 10.93571 0.04654590 [220,] 10.93571 0.04664553 [221,] 10.93510 0.04674579 [222,] 10.93478 0.04684668 [223,] 10.93447 0.04694822 [224,] 10.93415 0.04705039 [225,] 10.93382 0.04715322 [226,] 10.93350 0.04725670 [227,] 10.93350 0.04736085 [228,] 10.93284 0.04746568 [229,] 10.93250 0.04757118 [230,] 10.93216 0.04767736 [231,] 10.93182 0.04778424 [232,] 10.93147 0.04789182 [233,] 10.93112 0.04800011 [234,] 10.93112 0.04810911 [235,] 10.93041 0.04821884 [236,] 10.93005 0.04832929 [237,] 10.93005 0.04844048 [238,] 10.92932 0.04855242 [239,] 10.92895 0.04866511 [240,] 10.92857 0.04877857 [241,] 10.92857 0.04889279 [242,] 10.92781 0.04900779 [243,] 10.92742 0.04912358 [244,] 10.92742 0.04924016 [245,] 10.92663 0.04935755 [246,] 10.92623 0.04947575 [247,] 10.92582 0.04959477 [248,] 10.92582 0.04971462 [249,] 10.92500 0.04983531 [250,] 10.92458 0.04995684 [251,] 10.92458 0.05007924 [252,] 10.92373 0.05020251 [253,] 10.92330 0.05032665 [254,] 10.92286 0.05045168 [255,] 10.92241 0.05057760 [256,] 10.92197 0.05070443 [257,] 10.92151 0.05083218 [258,] 10.92105 0.05096086 [259,] 10.92059 0.05109048 [260,] 10.92012 0.05122104 [261,] 10.91964 0.05135256 [262,] 10.91916 0.05148505 [263,] 10.91867 0.05161853 [264,] 10.91818 0.05175300 [265,] 10.91768 0.05188847 [266,] 10.91718 0.05202495 [267,] 10.91667 0.05216246 [268,] 10.91615 0.05230102 [269,] 10.91563 0.05244062 [270,] 10.91509 0.05258128 [271,] 10.91456 0.05272302 [272,] 10.91401 0.05286585 [273,] 10.91346 0.05300978 [274,] 10.91290 0.05315482 [275,] 10.91234 0.05330098 [276,] 10.91176 0.05344829 [277,] 10.91118 0.05359675 [278,] 10.91060 0.05374637 [279,] 10.91000 0.05389717 [280,] 10.90940 0.05404917 [281,] 10.90878 0.05420237 [282,] 10.90816 0.05435679 [283,] 10.90753 0.05451245 [284,] 10.90690 0.05466936 [285,] 10.90625 0.05482753 [286,] 10.90559 0.05498698 > (midr <- midrange(x)) [1] 50 > 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/1ic7y1268864910.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/2pvae1268864910.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/38ze51268864910.tab") > > try(system("convert tmp/1ic7y1268864910.ps tmp/1ic7y1268864910.png",intern=TRUE)) character(0) > try(system("convert tmp/2pvae1268864910.ps tmp/2pvae1268864910.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 7.824 0.467 8.017