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