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