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(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) > 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.74217 > sqrtn <- sqrt(length(x)) > (armse <- sd(x) / sqrtn) [1] 0.06697915 > (armose <- arm / armse) [1] 160.3808 > (geo <- geomean(x)) [1] 10.56371 > (har <- harmean(x)) [1] 10.37887 > (qua <- quamean(x)) [1] 10.91390 > (win <- winmean(x)) [,1] [,2] [1,] 10.74217 0.06697915 [2,] 10.73976 0.06672876 [3,] 10.73976 0.06672876 [4,] 10.73976 0.06672876 [5,] 10.73976 0.06672876 [6,] 10.73253 0.06610329 [7,] 10.74096 0.06544800 [8,] 10.74096 0.06544800 [9,] 10.74096 0.06544800 [10,] 10.74096 0.06544800 [11,] 10.74096 0.06544800 [12,] 10.74096 0.06544800 [13,] 10.74096 0.06544800 [14,] 10.74096 0.06544800 [15,] 10.74096 0.06544800 [16,] 10.74096 0.06544800 [17,] 10.74096 0.06544800 [18,] 10.74096 0.06544800 [19,] 10.74096 0.06544800 [20,] 10.74096 0.06544800 [21,] 10.74096 0.06544800 [22,] 10.74096 0.06544800 [23,] 10.74096 0.06544800 [24,] 10.74096 0.06544800 [25,] 10.74096 0.06544800 [26,] 10.70964 0.06323111 [27,] 10.70964 0.06323111 [28,] 10.70964 0.06323111 [29,] 10.70964 0.06323111 [30,] 10.74578 0.06096487 [31,] 10.74578 0.06096487 [32,] 10.74578 0.06096487 [33,] 10.74578 0.06096487 [34,] 10.74578 0.06096487 [35,] 10.74578 0.06096487 [36,] 10.74578 0.06096487 [37,] 10.74578 0.06096487 [38,] 10.74578 0.06096487 [39,] 10.74578 0.06096487 [40,] 10.74578 0.06096487 [41,] 10.74578 0.06096487 [42,] 10.74578 0.06096487 [43,] 10.74578 0.06096487 [44,] 10.74578 0.06096487 [45,] 10.74578 0.06096487 [46,] 10.74578 0.06096487 [47,] 10.74578 0.06096487 [48,] 10.74578 0.06096487 [49,] 10.74578 0.06096487 [50,] 10.74578 0.06096487 [51,] 10.74578 0.06096487 [52,] 10.74578 0.06096487 [53,] 10.74578 0.06096487 [54,] 10.74578 0.06096487 [55,] 10.74578 0.06096487 [56,] 10.74578 0.06096487 [57,] 10.74578 0.06096487 [58,] 10.74578 0.06096487 [59,] 10.74578 0.06096487 [60,] 10.74578 0.06096487 [61,] 10.74578 0.06096487 [62,] 10.74578 0.06096487 [63,] 10.74578 0.06096487 [64,] 10.66867 0.05654364 [65,] 10.66867 0.05654364 [66,] 10.66867 0.05654364 [67,] 10.66867 0.05654364 [68,] 10.66867 0.05654364 [69,] 10.66867 0.05654364 [70,] 10.66867 0.05654364 [71,] 10.66867 0.05654364 [72,] 10.66867 0.05654364 [73,] 10.66867 0.05654364 [74,] 10.66867 0.05654364 [75,] 10.66867 0.05654364 [76,] 10.66867 0.05654364 [77,] 10.66867 0.05654364 [78,] 10.66867 0.05654364 [79,] 10.66867 0.05654364 [80,] 10.66867 0.05654364 [81,] 10.66867 0.05654364 [82,] 10.66867 0.05654364 [83,] 10.66867 0.05654364 [84,] 10.66867 0.05654364 [85,] 10.66867 0.05654364 [86,] 10.66867 0.05654364 [87,] 10.66867 0.05654364 [88,] 10.66867 0.05654364 [89,] 10.66867 0.05654364 [90,] 10.56024 0.05199925 [91,] 10.56024 0.05199925 [92,] 10.56024 0.05199925 [93,] 10.56024 0.05199925 [94,] 10.56024 0.05199925 [95,] 10.56024 0.05199925 [96,] 10.56024 0.05199925 [97,] 10.56024 0.05199925 [98,] 10.56024 0.05199925 [99,] 10.56024 0.05199925 [100,] 10.56024 0.05199925 [101,] 10.56024 0.05199925 [102,] 10.56024 0.05199925 [103,] 10.56024 0.05199925 [104,] 10.56024 0.05199925 [105,] 10.56024 0.05199925 [106,] 10.56024 0.05199925 [107,] 10.56024 0.05199925 [108,] 10.56024 0.05199925 [109,] 10.56024 0.05199925 [110,] 10.56024 0.05199925 [111,] 10.56024 0.05199925 [112,] 10.56024 0.05199925 [113,] 10.56024 0.05199925 [114,] 10.56024 0.05199925 [115,] 10.56024 0.05199925 [116,] 10.56024 0.05199925 [117,] 10.56024 0.05199925 [118,] 10.56024 0.05199925 [119,] 10.56024 0.05199925 [120,] 10.56024 0.05199925 [121,] 10.56024 0.05199925 [122,] 10.56024 0.05199925 [123,] 10.56024 0.05199925 [124,] 10.56024 0.05199925 [125,] 10.56024 0.05199925 [126,] 10.56024 0.05199925 [127,] 10.56024 0.05199925 [128,] 10.71446 0.04368879 [129,] 10.71446 0.04368879 [130,] 10.71446 0.04368879 [131,] 10.71446 0.04368879 [132,] 10.71446 0.04368879 [133,] 10.71446 0.04368879 [134,] 10.71446 0.04368879 [135,] 10.71446 0.04368879 [136,] 10.71446 0.04368879 [137,] 10.71446 0.04368879 [138,] 10.71446 0.04368879 [139,] 10.71446 0.04368879 [140,] 10.71446 0.04368879 [141,] 10.71446 0.04368879 [142,] 10.71446 0.04368879 [143,] 10.71446 0.04368879 [144,] 10.71446 0.04368879 [145,] 10.71446 0.04368879 [146,] 10.71446 0.04368879 [147,] 10.71446 0.04368879 [148,] 10.71446 0.04368879 [149,] 10.71446 0.04368879 [150,] 10.71446 0.04368879 [151,] 10.71446 0.04368879 [152,] 10.71446 0.04368879 [153,] 10.71446 0.04368879 [154,] 10.71446 0.04368879 [155,] 10.71446 0.04368879 [156,] 10.71446 0.04368879 [157,] 10.71446 0.04368879 [158,] 10.71446 0.04368879 [159,] 10.71446 0.04368879 [160,] 10.71446 0.04368879 [161,] 10.71446 0.04368879 [162,] 10.71446 0.04368879 [163,] 10.71446 0.04368879 [164,] 10.71446 0.04368879 [165,] 10.71446 0.04368879 [166,] 10.71446 0.04368879 [167,] 10.71446 0.04368879 [168,] 10.71446 0.04368879 [169,] 10.71446 0.04368879 [170,] 10.71446 0.04368879 [171,] 10.71446 0.04368879 [172,] 10.71446 0.04368879 [173,] 10.71446 0.04368879 [174,] 10.71446 0.04368879 [175,] 10.71446 0.04368879 [176,] 10.71446 0.04368879 [177,] 10.71446 0.04368879 [178,] 10.71446 0.04368879 [179,] 10.71446 0.04368879 [180,] 10.71446 0.04368879 [181,] 10.71446 0.04368879 [182,] 10.71446 0.04368879 [183,] 10.71446 0.04368879 [184,] 10.71446 0.04368879 [185,] 10.71446 0.04368879 [186,] 10.71446 0.04368879 [187,] 10.71446 0.04368879 [188,] 10.71446 0.04368879 [189,] 10.71446 0.04368879 [190,] 10.71446 0.04368879 [191,] 10.71446 0.04368879 [192,] 10.71446 0.04368879 [193,] 10.71446 0.04368879 [194,] 10.71446 0.04368879 [195,] 10.71446 0.04368879 [196,] 10.95060 0.03390510 [197,] 10.95060 0.03390510 [198,] 10.95060 0.03390510 [199,] 10.95060 0.03390510 [200,] 10.95060 0.03390510 [201,] 10.95060 0.03390510 [202,] 10.95060 0.03390510 [203,] 10.95060 0.03390510 [204,] 10.95060 0.03390510 [205,] 10.95060 0.03390510 [206,] 10.95060 0.03390510 [207,] 10.95060 0.03390510 [208,] 10.95060 0.03390510 [209,] 10.95060 0.03390510 [210,] 10.95060 0.03390510 [211,] 10.95060 0.03390510 [212,] 10.95060 0.03390510 [213,] 10.95060 0.03390510 [214,] 10.95060 0.03390510 [215,] 10.95060 0.03390510 [216,] 10.95060 0.03390510 [217,] 10.95060 0.03390510 [218,] 10.95060 0.03390510 [219,] 10.95060 0.03390510 [220,] 10.95060 0.03390510 [221,] 10.95060 0.03390510 [222,] 10.95060 0.03390510 [223,] 10.95060 0.03390510 [224,] 10.95060 0.03390510 [225,] 10.95060 0.03390510 [226,] 10.95060 0.03390510 [227,] 10.95060 0.03390510 [228,] 10.95060 0.03390510 [229,] 10.95060 0.03390510 [230,] 10.95060 0.03390510 [231,] 10.95060 0.03390510 [232,] 10.95060 0.03390510 [233,] 10.95060 0.03390510 [234,] 10.95060 0.03390510 [235,] 10.95060 0.03390510 [236,] 10.95060 0.03390510 [237,] 10.95060 0.03390510 [238,] 10.95060 0.03390510 [239,] 10.95060 0.03390510 [240,] 10.95060 0.03390510 [241,] 10.95060 0.03390510 [242,] 10.95060 0.03390510 [243,] 10.95060 0.03390510 [244,] 10.95060 0.03390510 [245,] 10.95060 0.03390510 [246,] 10.95060 0.03390510 [247,] 10.95060 0.03390510 [248,] 10.95060 0.03390510 [249,] 10.95060 0.03390510 [250,] 10.95060 0.03390510 [251,] 10.95060 0.03390510 [252,] 10.95060 0.03390510 [253,] 10.95060 0.03390510 [254,] 10.95060 0.03390510 [255,] 10.95060 0.03390510 [256,] 10.95060 0.03390510 [257,] 10.95060 0.03390510 [258,] 10.95060 0.03390510 [259,] 10.95060 0.03390510 [260,] 10.95060 0.03390510 [261,] 10.95060 0.03390510 [262,] 10.95060 0.03390510 [263,] 10.95060 0.03390510 [264,] 10.95060 0.03390510 [265,] 10.95060 0.03390510 [266,] 10.95060 0.03390510 [267,] 10.95060 0.03390510 [268,] 10.95060 0.03390510 [269,] 10.95060 0.03390510 [270,] 10.95060 0.03390510 [271,] 10.95060 0.03390510 [272,] 10.95060 0.03390510 [273,] 10.95060 0.03390510 [274,] 10.95060 0.03390510 [275,] 10.95060 0.03390510 [276,] 10.95060 0.03390510 > (tri <- trimean(x)) [,1] [,2] [1,] 10.74034 0.06646717 [2,] 10.73850 0.06594572 [3,] 10.73786 0.06554430 [4,] 10.73723 0.06513606 [5,] 10.73659 0.06472080 [6,] 10.73594 0.06429836 [7,] 10.73652 0.06398059 [8,] 10.73587 0.06375817 [9,] 10.73522 0.06353236 [10,] 10.73457 0.06330310 [11,] 10.73391 0.06307032 [12,] 10.73325 0.06283395 [13,] 10.73259 0.06259391 [14,] 10.73192 0.06235013 [15,] 10.73125 0.06210254 [16,] 10.73058 0.06185105 [17,] 10.72990 0.06159557 [18,] 10.72922 0.06133604 [19,] 10.72854 0.06107235 [20,] 10.72785 0.06080442 [21,] 10.72716 0.06053215 [22,] 10.72646 0.06025544 [23,] 10.72577 0.05997421 [24,] 10.72506 0.05968833 [25,] 10.72436 0.05939772 [26,] 10.72365 0.05910224 [27,] 10.72423 0.05890849 [28,] 10.72481 0.05871168 [29,] 10.72539 0.05851175 [30,] 10.72597 0.05830863 [31,] 10.72526 0.05819644 [32,] 10.72454 0.05808245 [33,] 10.72382 0.05796662 [34,] 10.72310 0.05784892 [35,] 10.72237 0.05772932 [36,] 10.72164 0.05760778 [37,] 10.72090 0.05748428 [38,] 10.72016 0.05735878 [39,] 10.71941 0.05723123 [40,] 10.71867 0.05710161 [41,] 10.71791 0.05696988 [42,] 10.71716 0.05683599 [43,] 10.71640 0.05669991 [44,] 10.71563 0.05656160 [45,] 10.71486 0.05642102 [46,] 10.71409 0.05627812 [47,] 10.71332 0.05613286 [48,] 10.71253 0.05598519 [49,] 10.71175 0.05583507 [50,] 10.71096 0.05568246 [51,] 10.71016 0.05552730 [52,] 10.70937 0.05536954 [53,] 10.70856 0.05520913 [54,] 10.70776 0.05504602 [55,] 10.70694 0.05488016 [56,] 10.70613 0.05471149 [57,] 10.70531 0.05453995 [58,] 10.70448 0.05436548 [59,] 10.70365 0.05418803 [60,] 10.70282 0.05400752 [61,] 10.70198 0.05382391 [62,] 10.70113 0.05363711 [63,] 10.70028 0.05344706 [64,] 10.69943 0.05325370 [65,] 10.70000 0.05316471 [66,] 10.70057 0.05307411 [67,] 10.70115 0.05298185 [68,] 10.70173 0.05288791 [69,] 10.70231 0.05279226 [70,] 10.70290 0.05269487 [71,] 10.70349 0.05259569 [72,] 10.70408 0.05249471 [73,] 10.70468 0.05239189 [74,] 10.70528 0.05228718 [75,] 10.70588 0.05218057 [76,] 10.70649 0.05207200 [77,] 10.70710 0.05196144 [78,] 10.70772 0.05184885 [79,] 10.70833 0.05173420 [80,] 10.70896 0.05161744 [81,] 10.70958 0.05149854 [82,] 10.71021 0.05137744 [83,] 10.71084 0.05125410 [84,] 10.71148 0.05112849 [85,] 10.71212 0.05100054 [86,] 10.71277 0.05087023 [87,] 10.71341 0.05073748 [88,] 10.71407 0.05060227 [89,] 10.71472 0.05046453 [90,] 10.71538 0.05032421 [91,] 10.71759 0.05026594 [92,] 10.71981 0.05020625 [93,] 10.72205 0.05014509 [94,] 10.72430 0.05008245 [95,] 10.72656 0.05001830 [96,] 10.72884 0.04995259 [97,] 10.73113 0.04988531 [98,] 10.73344 0.04981642 [99,] 10.73576 0.04974588 [100,] 10.73810 0.04967367 [101,] 10.74045 0.04959974 [102,] 10.74281 0.04952406 [103,] 10.74519 0.04944660 [104,] 10.74759 0.04936731 [105,] 10.74759 0.04928617 [106,] 10.75243 0.04920311 [107,] 10.75487 0.04911812 [108,] 10.75733 0.04903114 [109,] 10.75980 0.04894213 [110,] 10.76230 0.04885104 [111,] 10.76480 0.04875784 [112,] 10.76733 0.04866247 [113,] 10.76987 0.04856489 [114,] 10.77243 0.04846504 [115,] 10.77500 0.04836288 [116,] 10.77759 0.04825834 [117,] 10.78020 0.04815139 [118,] 10.78283 0.04804195 [119,] 10.78547 0.04792998 [120,] 10.78814 0.04781542 [121,] 10.79082 0.04769819 [122,] 10.79352 0.04757824 [123,] 10.79623 0.04745551 [124,] 10.79897 0.04732993 [125,] 10.80172 0.04720142 [126,] 10.80450 0.04706992 [127,] 10.80729 0.04693535 [128,] 10.81010 0.04679763 [129,] 10.81119 0.04680817 [130,] 10.81228 0.04681823 [131,] 10.81338 0.04682780 [132,] 10.81449 0.04683688 [133,] 10.81560 0.04684545 [134,] 10.81673 0.04685349 [135,] 10.81786 0.04686101 [136,] 10.81900 0.04686797 [137,] 10.82014 0.04687438 [138,] 10.82130 0.04688022 [139,] 10.82246 0.04688547 [140,] 10.82364 0.04689013 [141,] 10.82482 0.04689417 [142,] 10.82601 0.04689759 [143,] 10.82721 0.04690037 [144,] 10.82841 0.04690249 [145,] 10.82963 0.04690394 [146,] 10.83086 0.04690470 [147,] 10.83209 0.04690475 [148,] 10.83333 0.04690409 [149,] 10.83459 0.04690269 [150,] 10.83585 0.04690054 [151,] 10.83712 0.04689761 [152,] 10.83840 0.04689390 [153,] 10.83969 0.04688937 [154,] 10.84100 0.04688402 [155,] 10.84231 0.04687781 [156,] 10.84363 0.04687074 [157,] 10.84496 0.04686278 [158,] 10.84630 0.04685390 [159,] 10.84766 0.04684409 [160,] 10.84902 0.04683333 [161,] 10.85039 0.04682158 [162,] 10.85178 0.04680884 [163,] 10.85317 0.04679506 [164,] 10.85458 0.04678023 [165,] 10.85600 0.04676432 [166,] 10.85743 0.04674731 [167,] 10.85887 0.04672916 [168,] 10.86032 0.04670985 [169,] 10.86179 0.04668935 [170,] 10.86327 0.04666763 [171,] 10.86475 0.04664465 [172,] 10.86626 0.04662040 [173,] 10.86777 0.04659483 [174,] 10.86929 0.04656791 [175,] 10.87083 0.04653960 [176,] 10.87238 0.04650988 [177,] 10.87395 0.04647870 [178,] 10.87553 0.04644603 [179,] 10.87712 0.04641183 [180,] 10.87872 0.04637605 [181,] 10.88034 0.04633866 [182,] 10.88197 0.04629962 [183,] 10.88362 0.04625888 [184,] 10.88528 0.04621639 [185,] 10.88696 0.04617211 [186,] 10.88865 0.04612599 [187,] 10.89035 0.04607799 [188,] 10.89207 0.04602804 [189,] 10.89381 0.04597610 [190,] 10.89556 0.04592211 [191,] 10.89732 0.04586601 [192,] 10.89910 0.04580776 [193,] 10.90090 0.04574728 [194,] 10.90271 0.04568451 [195,] 10.90455 0.04561939 [196,] 10.90639 0.04555186 [197,] 10.90596 0.04564467 [198,] 10.90553 0.04573803 [199,] 10.90509 0.04583194 [200,] 10.90465 0.04592642 [201,] 10.90421 0.04602145 [202,] 10.90376 0.04611705 [203,] 10.90330 0.04621323 [204,] 10.90284 0.04630999 [205,] 10.90238 0.04640733 [206,] 10.90191 0.04650526 [207,] 10.90144 0.04660379 [208,] 10.90097 0.04670292 [209,] 10.90049 0.04680266 [210,] 10.90049 0.04690301 [211,] 10.89951 0.04700398 [212,] 10.89901 0.04710558 [213,] 10.89901 0.04720781 [214,] 10.89801 0.04731067 [215,] 10.89750 0.04741418 [216,] 10.89698 0.04751834 [217,] 10.89646 0.04762315 [218,] 10.89594 0.04772863 [219,] 10.89541 0.04783478 [220,] 10.89487 0.04794160 [221,] 10.89433 0.04804910 [222,] 10.89378 0.04815729 [223,] 10.89323 0.04826617 [224,] 10.89267 0.04837576 [225,] 10.89211 0.04848606 [226,] 10.89153 0.04859707 [227,] 10.89096 0.04870881 [228,] 10.89037 0.04882127 [229,] 10.88978 0.04893448 [230,] 10.88919 0.04904842 [231,] 10.88859 0.04916312 [232,] 10.88798 0.04927858 [233,] 10.88736 0.04939481 [234,] 10.88674 0.04951181 [235,] 10.88611 0.04962959 [236,] 10.88547 0.04974816 [237,] 10.88483 0.04986753 [238,] 10.88418 0.04998771 [239,] 10.88352 0.05010870 [240,] 10.88286 0.05023051 [241,] 10.88218 0.05035315 [242,] 10.88150 0.05047663 [243,] 10.88081 0.05060095 [244,] 10.88012 0.05072613 [245,] 10.87941 0.05085218 [246,] 10.87870 0.05097909 [247,] 10.87798 0.05110689 [248,] 10.87725 0.05123557 [249,] 10.87651 0.05136515 [250,] 10.87576 0.05149564 [251,] 10.87500 0.05162705 [252,] 10.87423 0.05175938 [253,] 10.87346 0.05189264 [254,] 10.87267 0.05202685 [255,] 10.87187 0.05216200 [256,] 10.87107 0.05229812 [257,] 10.87025 0.05243521 [258,] 10.86943 0.05257328 [259,] 10.86859 0.05271234 [260,] 10.86774 0.05285239 [261,] 10.86688 0.05299345 [262,] 10.86601 0.05313554 [263,] 10.86513 0.05327864 [264,] 10.86424 0.05342279 [265,] 10.86333 0.05356798 [266,] 10.86242 0.05371422 [267,] 10.86149 0.05386153 [268,] 10.86054 0.05400991 [269,] 10.85959 0.05415938 [270,] 10.85862 0.05430994 [271,] 10.85764 0.05446161 [272,] 10.85664 0.05461438 [273,] 10.85563 0.05476828 [274,] 10.85461 0.05492331 [275,] 10.85357 0.05507947 [276,] 10.85252 0.05523679 > (midr <- midrange(x)) [1] 11.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/freestat/rcomp/tmp/1jcq41218992330.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/freestat/rcomp/tmp/2hhhe1218992330.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/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/3e7qb1218992331.tab") > > system("convert tmp/1jcq41218992330.ps tmp/1jcq41218992330.png") > system("convert tmp/2hhhe1218992330.ps tmp/2hhhe1218992330.png") > > > proc.time() user system elapsed 10.129 0.638 10.253