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(196.9 + ,192.1 + ,201.8 + ,186.9 + ,218.0 + ,214.4 + ,227.5 + ,204.1 + ,225.8 + ,223.7 + ,244.7 + ,243.9 + ,257.3 + ,234.5 + ,251.4 + ,243.8 + ,247.4 + ,245.3 + ,262.5 + ,270.0 + ,259.9 + ,262.2 + ,244.9 + ,249.3 + ,268.2 + ,231.2 + ,264.3 + ,252.7 + ,275.5 + ,261.5 + ,275.5 + ,272.3 + ,268.6 + ,270.4 + ,267.7 + ,275.0 + ,272.6 + ,248.6 + ,279.4 + ,270.5 + ,292.8 + ,297.8 + ,296.8 + ,290.9 + ,282.8 + ,312.8 + ,303.2 + ,301.4 + ,289.8 + ,279.6 + ,302.2 + ,299.1 + ,319.7 + ,310.9 + ,315.2 + ,338.5 + ,315.6 + ,321.2 + ,318.5 + ,342.7 + ,261.4 + ,287.0 + ,331.5 + ,326.9 + ,338.6 + ,337.0 + ,358.4 + ,344.5 + ,345.7 + ,344.1 + ,317.4 + ,354.5 + ,345.2 + ,314.1 + ,352.5 + ,361.2 + ,365.9 + ,332.5 + ,364.0 + ,359.1 + ,345.6 + ,366.9 + ,370.2 + ,359.9 + ,366.6 + ,336.3 + ,368.5 + ,374.2 + ,384.3 + ,358.9 + ,407.7 + ,433.3 + ,404.7 + ,392.7 + ,409.7 + ,416.5 + ,414.3 + ,404.3 + ,421.4 + ,372.6 + ,404.7 + ,420.2 + ,438.4 + ,449.1 + ,445.8 + ,413.8 + ,420.5 + ,442.3 + ,438.9 + ,394.5 + ,416.8 + ,402.9 + ,424.5 + ,432.3 + ,484.1 + ,492.7 + ,496.3 + ,471.9 + ,491.2 + ,512.9 + ,482.4 + ,407.9 + ,448.5 + ,431.1 + ,498.8 + ,497.1 + ,517.1 + ,487.7 + ,512.5 + ,550.1 + ,532.5 + ,524.1 + ,515.7 + ,461.0 + ,529.3 + ,467.4 + ,559.8 + ,536.5 + ,531.9 + ,546.5 + ,547.4 + ,536.1 + ,482.8 + ,551.0 + ,532.9 + ,484.1 + ,554.8 + ,537.0 + ,558.0 + ,511.4 + ,502.9 + ,558.6 + ,545.1 + ,574.3 + ,542.2 + ,600.0 + ,588.6 + ,524.4 + ,618.5 + ,580.9 + ,557.2 + ,571.2 + ,597.5 + ,601.7 + ,558.9 + ,600.9 + ,601.0 + ,615.7 + ,578.1 + ,495.9 + ,526.8 + ,522.1 + ,605.1 + ,574.4 + ,609.7 + ,580.7 + ,565.1 + ,590.7 + ,571.5 + ,601.3 + ,567.3 + ,467.9 + ,588.9 + ,579.4 + ,502.6 + ,568.7 + ,616.0 + ,586.2 + ,575.5 + ,599.9 + ,568.2 + ,516.0 + ,493.4 + ,496.8 + ,529.9 + ,491.7 + ,543.2 + ,490.8 + ,554.7 + ,625.7 + ,605.0 + ,645.2 + ,645.2 + ,611.8 + ,600.3 + ,549.8 + ,635.5 + ,617.7 + ,643.5 + ,485.7 + ,689.5 + ,692.0 + ,677.3 + ,704.7 + ,668.6 + ,717.8 + ,689.8 + ,640.4 + ,675.2 + ,528.1 + ,538.0 + ,527.2 + ,655.6 + ,650.6 + ,623.7 + ,748.4 + ,727.4 + ,750.5 + ,678.9 + ,659.5 + ,691.9 + ,639.8 + ,663.8 + ,572.9 + ,592.5 + ,734.8 + ,696.1 + ,589.2 + ,662.9 + ,661.2 + ,672.1 + ,583.7 + ,705.5 + ,631.0 + ,733.3 + ,674.9 + ,695.5 + ,634.1 + ,630.6 + ,635.2 + ,554.1 + ,623.9 + ,679.3 + ,565.6 + ,564.1 + ,637.2 + ,650.8 + ,602.7 + ,587.5 + ,619.2 + ,616.5 + ,637.9 + ,557.9 + ,594.0 + ,668.7 + ,603.3 + ,674.5 + ,573.4 + ,706.0 + ,693.7 + ,627.5 + ,550.7 + ,592.3 + ,660.2 + ,597.3 + ,641.0 + ,663.6 + ,595.9 + ,638.4 + ,665.4 + ,671.4 + ,637.0 + ,685.7 + ,705.8 + ,704.8 + ,734.4 + ,674.2 + ,748.6 + ,763.4 + ,658.0 + ,627.5 + ,528.9 + ,488.3 + ,575.5 + ,735.6 + ,685.3 + ,613.6 + ,629.5 + ,634.7 + ,652.6 + ,728.3 + ,634.3 + ,690.7 + ,676.3 + ,675.4 + ,595.6 + ,712.4 + ,735.8 + ,544.4 + ,567.0 + ,510.0 + ,564.0 + ,630.7 + ,496.7 + ,660.9 + ,601.2 + ,655.2 + ,591.6 + ,606.1 + ,560.7 + ,368.3 + ,371.6 + ,413.9 + ,413.9 + ,389.0 + ,399.2 + ,429.8 + ,395.6 + ,472.0 + ,486.0 + ,525.0 + ,396.0 + ,511.0 + ,525.0 + ,492.0 + ,517.0 + ,525.0 + ,474.0 + ,539.0 + ,468.0 + ,543.0 + ,532.0 + ,565.0 + ,535.0 + ,534.0 + ,546.0 + ,494.0 + ,552.0 + ,511.0 + ,451.0 + ,537.0 + ,494.0 + ,549.0 + ,544.0 + ,598.0 + ,583.0 + ,582.0 + ,589.0 + ,578.0 + ,561.0 + ,592.0 + ,504.0 + ,545.0 + ,547.0 + ,585.0 + ,562.0 + ,520.0 + ,581.0 + ,590.0 + ,562.0 + ,548.0 + ,567.0 + ,542.0 + ,473.0 + ,531.0 + ,462.0 + ,479.0 + ,533.0 + ,552.0 + ,547.0 + ,562.0 + ,524.0 + ,479.0 + ,445.0 + ,406.0 + ,475.0 + ,589.0 + ,495.0 + ,484.0 + ,536.0 + ,555.0 + ,565.0 + ,564.0 + ,573.0 + ,569.0 + ,588.0 + ,546.0 + ,508.0 + ,560.0 + ,558.0 + ,516.0 + ,549.0 + ,595.0 + ,586.0 + ,597.0 + ,592.0 + ,538.0 + ,590.0 + ,576.0 + ,451.0 + ,538.0 + ,555.0 + ,532.0 + ,530.0 + ,553.0 + ,626.0 + ,601.0 + ,573.0 + ,569.0 + ,562.0 + ,468.0 + ,483.0 + ,460.0 + ,411.0 + ,458.0 + ,455.0 + ,600.0 + ,605.0 + ,545.0 + ,549.0 + ,415.0 + ,568.0 + ,577.0 + ,517.0 + ,558.0 + ,518.0 + ,489.0 + ,502.0 + ,569.0 + ,540.0 + ,550.0 + ,557.0 + ,542.0 + ,542.0 + ,582.0 + ,525.0 + ,584.0 + ,562.0 + ,639.0 + ,613.0 + ,604.0 + ,613.0 + ,625.0 + ,654.0 + ,638.0) > 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] 508.0259 > sqrtn <- sqrt(length(x)) > (armse <- sd(x) / sqrtn) [1] 6.183107 > (armose <- arm / armse) [1] 82.16354 > (geo <- geomean(x)) [1] 487.5207 > (har <- harmean(x)) [1] 463.1254 > (qua <- quamean(x)) [1] 524.8306 > (win <- winmean(x)) [,1] [,2] [1,] 508.0090 6.179295 [2,] 508.0218 6.176217 [3,] 508.0527 6.172546 [4,] 507.9622 6.161081 [5,] 508.0732 6.148800 [6,] 508.1101 6.142975 [7,] 508.1916 6.133435 [8,] 508.2092 6.128107 [9,] 508.1440 6.116780 [10,] 508.2055 6.107042 [11,] 508.0532 6.081113 [12,] 508.1560 6.046443 [13,] 507.9760 6.032754 [14,] 507.9945 6.029939 [15,] 507.9912 6.028591 [16,] 507.9807 6.025466 [17,] 508.0554 6.017687 [18,] 507.7626 5.989132 [19,] 507.7668 5.984615 [20,] 507.7800 5.970412 [21,] 507.7615 5.959384 [22,] 507.9791 5.938230 [23,] 508.0499 5.921924 [24,] 508.0815 5.911417 [25,] 508.0705 5.909797 [26,] 507.8934 5.891562 [27,] 507.8875 5.888351 [28,] 507.6290 5.854019 [29,] 507.8202 5.832626 [30,] 507.7477 5.822847 [31,] 507.7068 5.816018 [32,] 507.7420 5.803083 [33,] 507.7565 5.799543 [34,] 507.7415 5.797445 [35,] 507.8492 5.783040 [36,] 507.8492 5.779406 [37,] 507.8736 5.751169 [38,] 507.8569 5.743775 [39,] 507.6255 5.729352 [40,] 507.9596 5.698363 [41,] 507.6892 5.678998 [42,] 507.8369 5.643949 [43,] 508.2149 5.608123 [44,] 508.4180 5.580549 [45,] 508.3587 5.560955 [46,] 508.5204 5.542612 [47,] 508.8613 5.502986 [48,] 508.8930 5.489573 [49,] 508.8714 5.467996 [50,] 508.8604 5.430914 [51,] 508.9053 5.420709 [52,] 508.8824 5.402985 [53,] 509.6163 5.318818 [54,] 509.6281 5.287689 [55,] 509.7611 5.273404 [56,] 509.2319 5.223731 [57,] 509.2820 5.219633 [58,] 509.2947 5.188522 [59,] 509.1132 5.158545 [60,] 509.1923 5.141230 [61,] 509.3130 5.120412 [62,] 509.9807 5.051858 [63,] 510.5345 4.996624 [64,] 510.6189 4.982365 [65,] 511.1475 4.939020 [66,] 511.1475 4.925375 [67,] 511.3389 4.906545 [68,] 511.1297 4.892786 [69,] 511.7059 4.842187 [70,] 511.8444 4.821335 [71,] 511.8444 4.813053 [72,] 511.9235 4.802803 [73,] 511.4903 4.770234 [74,] 511.4578 4.766298 [75,] 512.5622 4.680231 [76,] 512.7125 4.644925 [77,] 513.0341 4.576913 [78,] 513.1198 4.570538 [79,] 512.8941 4.553654 [80,] 512.9820 4.540314 [81,] 513.0888 4.516340 [82,] 513.3952 4.468259 [83,] 513.7053 4.440803 [84,] 513.0037 4.386499 [85,] 512.9290 4.375418 [86,] 513.0424 4.347963 [87,] 512.8512 4.333031 [88,] 513.0833 4.303852 [89,] 513.2985 4.280765 [90,] 513.0809 4.244566 [91,] 513.2809 4.215017 [92,] 515.3231 4.068338 [93,] 516.0385 3.987583 [94,] 516.3690 3.911266 [95,] 515.9932 3.845953 [96,] 516.0143 3.818955 [97,] 516.0782 3.811940 [98,] 516.7675 3.764320 [99,] 517.3549 3.697954 [100,] 517.5088 3.669078 [101,] 517.4644 3.656195 [102,] 517.2402 3.644718 [103,] 517.4440 3.620113 [104,] 517.8097 3.592655 [105,] 517.8097 3.587181 [106,] 518.2290 3.558947 [107,] 518.5112 3.537241 [108,] 519.0334 3.485584 [109,] 518.9855 3.480303 [110,] 518.9855 3.480303 [111,] 519.0587 3.472565 [112,] 518.7633 3.437246 [113,] 519.0116 3.406210 [114,] 519.0367 3.398686 [115,] 519.8202 3.338117 [116,] 519.6163 3.318847 [117,] 519.7705 3.299732 [118,] 520.4189 3.239232 [119,] 521.5435 3.136072 [120,] 521.4908 3.093928 [121,] 521.7567 3.070731 [122,] 521.9444 3.049474 [123,] 523.3231 2.961792 [124,] 523.3503 2.947626 [125,] 524.0371 2.876301 [126,] 524.5910 2.819757 [127,] 524.8143 2.805890 [128,] 525.3488 2.747415 [129,] 525.4622 2.734039 [130,] 526.0051 2.700736 [131,] 525.9763 2.699258 [132,] 527.0497 2.624181 [133,] 527.7512 2.562300 [134,] 528.1930 2.519451 [135,] 528.1040 2.481828 [136,] 528.3431 2.460969 [137,] 529.6679 2.349645 [138,] 529.5163 2.325100 [139,] 529.4552 2.318590 [140,] 529.2398 2.307514 [141,] 530.1385 2.221366 [142,] 530.1697 2.219564 [143,] 530.1697 2.185304 [144,] 530.4545 2.165476 [145,] 530.7095 2.143934 [146,] 531.5758 2.049498 [147,] 531.1558 2.027997 [148,] 532.2292 1.964102 [149,] 532.0327 1.940017 [150,] 531.7690 1.919547 [151,] 531.9349 1.892586 > (tri <- trimean(x)) [,1] [,2] [1,] 508.1711 6.143885 [2,] 508.3346 6.107502 [3,] 508.4931 6.071719 [4,] 508.6425 6.036242 [5,] 508.8164 6.002850 [6,] 508.9691 5.971204 [7,] 509.1168 5.939746 [8,] 509.2538 5.908933 [9,] 509.3897 5.878009 [10,] 509.5345 5.847650 [11,] 509.6741 5.817564 [12,] 509.8297 5.789377 [13,] 509.9776 5.763811 [14,] 510.1417 5.738756 [15,] 510.3059 5.713218 [16,] 510.4719 5.687047 [17,] 510.6401 5.660352 [18,] 510.8053 5.633454 [19,] 510.9897 5.607762 [20,] 511.1757 5.581610 [21,] 511.3627 5.555604 [22,] 511.5526 5.529507 [23,] 511.7333 5.503925 [24,] 511.9123 5.478531 [25,] 512.0916 5.452964 [26,] 512.2732 5.426700 [27,] 512.4643 5.400598 [28,] 512.6576 5.373852 [29,] 512.6576 5.348015 [30,] 513.0638 5.322457 [31,] 513.0638 5.296564 [32,] 513.4777 5.270172 [33,] 513.6874 5.243550 [34,] 513.8987 5.216238 [35,] 514.1127 5.188136 [36,] 514.3253 5.159784 [37,] 514.5402 5.130666 [38,] 514.7565 5.101836 [39,] 514.9756 5.072370 [40,] 515.2043 5.042514 [41,] 515.4252 5.013011 [42,] 515.6566 4.983291 [43,] 515.8862 4.954030 [44,] 516.1074 4.925282 [45,] 516.3252 4.896687 [46,] 516.5471 4.867883 [47,] 516.7670 4.838827 [48,] 516.9802 4.810358 [49,] 517.1950 4.781419 [50,] 517.4127 4.752290 [51,] 517.6331 4.723550 [52,] 517.8550 4.694177 [53,] 518.0799 4.664418 [54,] 518.2893 4.636845 [55,] 518.5009 4.609427 [56,] 518.7117 4.581553 [57,] 518.9375 4.554401 [58,] 518.9375 4.526397 [59,] 519.3947 4.498482 [60,] 519.6313 4.470573 [61,] 519.8691 4.442243 [62,] 519.8691 4.413602 [63,] 520.3328 4.386427 [64,] 520.5492 4.360250 [65,] 520.7665 4.333576 [66,] 520.9749 4.307471 [67,] 521.1860 4.280823 [68,] 521.3956 4.253817 [69,] 521.6123 4.226189 [70,] 521.8197 4.199328 [71,] 522.0268 4.172141 [72,] 522.2367 4.144146 [73,] 522.4476 4.115385 [74,] 522.6700 4.086518 [75,] 522.8961 4.056589 [76,] 523.1030 4.028650 [77,] 523.3096 4.000809 [78,] 523.5127 3.974229 [79,] 523.7168 3.946761 [80,] 523.9281 3.918671 [81,] 524.1406 3.889860 [82,] 524.3540 3.860669 [83,] 524.5644 3.831969 [84,] 524.7718 3.803042 [85,] 524.9954 3.774620 [86,] 525.2237 3.745302 [87,] 525.4530 3.715666 [88,] 525.6892 3.685172 [89,] 525.9245 3.654388 [90,] 526.1593 3.623069 [91,] 526.4015 3.591557 [92,] 526.6435 3.559695 [93,] 526.8517 3.532173 [94,] 527.0498 3.506407 [95,] 527.2449 3.482204 [96,] 527.4498 3.459059 [97,] 527.6575 3.435742 [98,] 527.8672 3.411539 [99,] 528.0677 3.388007 [100,] 528.2608 3.365807 [101,] 528.4542 3.343553 [102,] 528.6514 3.320618 [103,] 528.8558 3.296867 [104,] 529.0599 3.272839 [105,] 529.2608 3.248667 [106,] 529.4650 3.223429 [107,] 529.6651 3.198031 [108,] 529.8636 3.172179 [109,] 530.0561 3.147051 [110,] 530.2528 3.120754 [111,] 530.4528 3.093020 [112,] 530.6550 3.064086 [113,] 530.8659 3.034872 [114,] 531.0762 3.005350 [115,] 531.2898 2.974466 [116,] 531.2898 2.944576 [117,] 531.4933 2.913697 [118,] 531.9160 2.881872 [119,] 532.1203 2.850979 [120,] 532.3084 2.823017 [121,] 532.5009 2.795156 [122,] 532.6924 2.766695 [123,] 532.6924 2.737484 [124,] 532.8842 2.710762 [125,] 533.2288 2.683016 [126,] 533.3936 2.656908 [127,] 533.5517 2.631824 [128,] 533.7090 2.605831 [129,] 533.8599 2.580965 [130,] 534.0118 2.555129 [131,] 534.1570 2.529304 [132,] 534.3058 2.501833 [133,] 534.4381 2.476415 [134,] 534.5604 2.452412 [135,] 534.6773 2.428930 [136,] 534.7984 2.405608 [137,] 534.9177 2.381742 [138,] 535.0151 2.361922 [139,] 535.1175 2.341825 [140,] 535.2234 2.320573 [141,] 535.3358 2.298261 [142,] 535.4339 2.278872 [143,] 535.5337 2.258122 [144,] 535.6359 2.237557 [145,] 535.7352 2.216524 [146,] 535.8319 2.195071 [147,] 535.9143 2.177168 [148,] 536.0069 2.158843 [149,] 536.0809 2.142690 [150,] 536.1606 2.126414 [151,] 536.2477 2.109787 > (midr <- midrange(x)) [1] 475.15 > midm <- array(NA,dim=8) > for (j in 1:8) midm[j] <- midmean(x,j) > midm [1] 530.5737 530.8659 530.8659 530.8659 531.0762 530.5737 530.8659 530.8659 > postscript(file="/var/www/html/rcomp/tmp/1ljum1269599018.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/2wab71269599018.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/3hw261269599018.tab") > > try(system("convert tmp/1ljum1269599018.ps tmp/1ljum1269599018.png",intern=TRUE)) character(0) > try(system("convert tmp/2wab71269599018.ps tmp/2wab71269599018.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.739 0.375 6.497