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(93.2 + ,96 + ,95.2 + ,77.1 + ,70.9 + ,64.8 + ,70.1 + ,77.3 + ,79.5 + ,100.6 + ,100.7 + ,107.1 + ,95.9 + ,82.8 + ,83.3 + ,80 + ,80.4 + ,67.5 + ,75.7 + ,71.1 + ,89.3 + ,101.1 + ,105.2 + ,114.1 + ,96.3 + ,84.4 + ,91.2 + ,81.9 + ,80.5 + ,70.4 + ,74.8 + ,75.9 + ,86.3 + ,98.7 + ,100.9 + ,113.8 + ,89.8 + ,84.4 + ,87.2 + ,85.6 + ,72 + ,69.2 + ,77.5 + ,78.1 + ,94.3 + ,97.7 + ,100.2 + ,116.4 + ,97.1 + ,93 + ,96 + ,80.5 + ,76.1 + ,69.9 + ,73.6 + ,92.6 + ,94.2 + ,93.5 + ,108.5 + ,109.4 + ,105.1 + ,92.5 + ,97.1 + ,81.4 + ,79.1 + ,72.1 + ,78.7 + ,87.1 + ,91.4 + ,109.9 + ,116.3 + ,113 + ,100 + ,84.8 + ,94.3 + ,87.1 + ,90.3 + ,72.4 + ,84.9 + ,92.7 + ,92.2 + ,114.9 + ,112.5 + ,118.3 + ,106 + ,91.2 + ,96.6 + ,96.3 + ,88.2 + ,70.2 + ,86.5 + ,88.2 + ,102.8 + ,119.1 + ,119.2 + ,125.1 + ,106.1 + ,102.1 + ,105.2 + ,101 + ,84.3 + ,87.5 + ,92.7 + ,94.4 + ,113 + ,113.9 + ,122.9 + ,132.7 + ,106.9 + ,96.6 + ,127.3 + ,98.2 + ,100.2 + ,89.4 + ,95.3 + ,104.2 + ,106.4 + ,116.2 + ,135.9 + ,134 + ,104.6 + ,107.1 + ,123.5 + ,98.8 + ,98.6 + ,90.6 + ,89.1 + ,105.2 + ,114 + ,122.1 + ,138 + ,142.2 + ,116.4 + ,112.6 + ,123.8 + ,103.6 + ,113.9 + ,98.6 + ,95 + ,116 + ,113.9 + ,127.5 + ,131.4 + ,145.9 + ,131.5 + ,131 + ,130.5 + ,118.9 + ,114.3 + ,85.7 + ,104.6 + ,105.1 + ,117.3 + ,142.5 + ,140 + ,159.8 + ,131.2 + ,125.4 + ,126.5 + ,119.4 + ,113.5 + ,98.7 + ,114.5 + ,113.8 + ,133.1 + ,143.4 + ,137.3 + ,165.2 + ,126.9 + ,124 + ,135.7 + ,130 + ,109.4 + ,117.8 + ,120.3 + ,121 + ,132.3 + ,142.9 + ,147.4 + ,175.9 + ,132.6 + ,123.7 + ,153.3 + ,134 + ,119.6 + ,116.2 + ,118.6 + ,130.7 + ,129.3 + ,144.4 + ,163.2 + ,179.4 + ,128.1 + ,138.4 + ,152.7 + ,120 + ,140.5 + ,116.2 + ,121.4 + ,127.8 + ,143.6 + ,157.6 + ,166.2 + ,182.3 + ,153.1 + ,147.6 + ,157.7 + ,137.2 + ,151.5 + ,98.7 + ,145.8 + ,151.7 + ,129.4 + ,174.1 + ,197 + ,193.9 + ,164.1 + ,142.8 + ,157.9 + ,159.2 + ,162.2 + ,123.1 + ,130 + ,150.1 + ,169.4 + ,179.7 + ,182.1 + ,194.3 + ,161.4 + ,169.4 + ,168.8 + ,158.1 + ,158.5 + ,135.3 + ,149.3 + ,143.4 + ,142.2 + ,188.4 + ,166.2 + ,199.2 + ,182.7 + ,145.2 + ,182.1 + ,158.7 + ,141.6 + ,132.6 + ,139.6 + ,147 + ,166.6 + ,157 + ,180.4 + ,210.2 + ,159.8 + ,157.8 + ,168.2 + ,158.4 + ,152 + ,142.2 + ,137.2 + ,152.6 + ,166.8 + ,165.6 + ,198.6 + ,201.5 + ,170.7 + ,164.4 + ,179.7 + ,157 + ,168 + ,139.3 + ,138.6 + ,153.4 + ,138.9 + ,172.1 + ,198.4 + ,217.8 + ,173.7 + ,153.8 + ,175.6 + ,147.1 + ,160.3 + ,135.2 + ,148.8 + ,151 + ,148.2 + ,182.2 + ,189.2 + ,183.1 + ,170 + ,158.4 + ,176.1 + ,156.2 + ,153.2 + ,117.9 + ,149.8 + ,156.6 + ,166.7 + ,156.8 + ,158.6 + ,210.8 + ,203.6 + ,175.2 + ,168.7 + ,155.9 + ,147.3 + ,137 + ,141.1 + ,167.4 + ,160.2 + ,191.9 + ,174.4 + ,208.2 + ,159.4 + ,161.1 + ,172.1 + ,158.4 + ,114.6 + ,159.6 + ,159.7 + ,159.4 + ,160.7 + ,165.5 + ,205 + ,205.2 + ,141.6 + ,148.1 + ,184.9 + ,132.5 + ,137.3 + ,135.5 + ,121.7 + ,166.1 + ,146.8 + ,162.8 + ,186.8 + ,185.5 + ,151.5 + ,158.1 + ,143 + ,151.2 + ,147.6 + ,130.7 + ,137.5 + ,146.1 + ,133.6 + ,167.9 + ,181.9 + ,202 + ,166.5 + ,151.3 + ,146.2 + ,148.3 + ,144.7 + ,123.6 + ,151.6 + ,133.9 + ,137.4 + ,181.6 + ,182 + ,190 + ,161.2 + ,155.5 + ,141.9 + ,164.6 + ,136.2 + ,126.8 + ,152.5 + ,126.6 + ,150.1 + ,186.3 + ,147.5 + ,200.4 + ,177.2 + ,127.4 + ,177.1 + ,154.4 + ,135.2 + ,126.4 + ,147.3 + ,140.6 + ,152.3 + ,151.2 + ,172.2 + ,215.3 + ,154.1 + ,159.3 + ,160.4 + ,151.9 + ,148.4 + ,139.6 + ,148.2 + ,153.5 + ,145.1 + ,183.7 + ,210.5 + ,203.3 + ,153.3 + ,144.3 + ,169.6 + ,143.7 + ,160.1 + ,135.6 + ,141.8 + ,159.9 + ,145.7 + ,183.5 + ,198.2 + ,186.8 + ,172 + ,150.6 + ,163.3 + ,153.7 + ,152.9 + ,135.5 + ,148.5 + ,148.4 + ,133.6 + ,194.1 + ,208.6 + ,197.3 + ,164.4 + ,148.1 + ,152 + ,144.1 + ,155 + ,124.5 + ,153 + ,146 + ,138 + ,190 + ,192 + ,192 + ,147 + ,133 + ,163 + ,150 + ,129 + ,131 + ,145 + ,137 + ,138 + ,168 + ,176 + ,188 + ,139 + ,143 + ,150 + ,154 + ,137 + ,129 + ,128 + ,140 + ,143 + ,151 + ,177 + ,184 + ,151 + ,134 + ,164 + ,126 + ,131 + ,125 + ,127 + ,143 + ,143 + ,160 + ,190 + ,182 + ,138 + ,136 + ,152 + ,127 + ,151 + ,130 + ,119 + ,153) > 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] 136.3954 > sqrtn <- sqrt(length(x)) > (armse <- sd(x) / sqrtn) [1] 1.546412 > (armose <- arm / armse) [1] 88.2012 > (geo <- geomean(x)) [1] 131.9416 > (har <- harmean(x)) [1] 127.2056 > (qua <- quamean(x)) [1] 140.4977 > (win <- winmean(x)) [,1] [,2] [1,] 136.3958 1.5452959 [2,] 136.3840 1.5426569 [3,] 136.3866 1.5420627 [4,] 136.3857 1.5416558 [5,] 136.3700 1.5398839 [6,] 136.3674 1.5391594 [7,] 136.3307 1.5342456 [8,] 136.3307 1.5336269 [9,] 136.3212 1.5296386 [10,] 136.3170 1.5288703 [11,] 136.2939 1.5255106 [12,] 136.3116 1.5217245 [13,] 136.3143 1.5162119 [14,] 136.3055 1.5108467 [15,] 136.2929 1.5086645 [16,] 136.2929 1.5075149 [17,] 136.3214 1.5039143 [18,] 136.2950 1.5003571 [19,] 136.2910 1.4986739 [20,] 136.2027 1.4870927 [21,] 136.2204 1.4841991 [22,] 136.2296 1.4819365 [23,] 136.1571 1.4729448 [24,] 136.1824 1.4709105 [25,] 136.1981 1.4688063 [26,] 136.0998 1.4601932 [27,] 136.0998 1.4601932 [28,] 136.1527 1.4559755 [29,] 136.1345 1.4497948 [30,] 136.1408 1.4414849 [31,] 136.1473 1.4369723 [32,] 136.1338 1.4257147 [33,] 136.1408 1.4251845 [34,] 136.1050 1.4225216 [35,] 136.0756 1.4159288 [36,] 136.0378 1.4120320 [37,] 136.0223 1.4028321 [38,] 136.0063 1.4005075 [39,] 136.0391 1.3956305 [40,] 136.0223 1.3919706 [41,] 136.0395 1.3856660 [42,] 136.0042 1.3831714 [43,] 136.0042 1.3818632 [44,] 136.0227 1.3791549 [45,] 136.0889 1.3742767 [46,] 136.0792 1.3735960 [47,] 136.1681 1.3671147 [48,] 136.1782 1.3649433 [49,] 136.1576 1.3620256 [50,] 136.0735 1.3502084 [51,] 136.0521 1.3411910 [52,] 136.0849 1.3388421 [53,] 136.1183 1.3317930 [54,] 135.8687 1.3149959 [55,] 135.8803 1.3125810 [56,] 135.9626 1.3051234 [57,] 135.8908 1.2955005 [58,] 135.8908 1.2938460 [59,] 135.8908 1.2921649 [60,] 135.8529 1.2897057 [61,] 135.8401 1.2836836 [62,] 135.7620 1.2751664 [63,] 135.7620 1.2698521 [64,] 135.8023 1.2598712 [65,] 135.6111 1.2461025 [66,] 135.5973 1.2452461 [67,] 135.6113 1.2442640 [68,] 135.6828 1.2374269 [69,] 135.5233 1.2238944 [70,] 135.4351 1.2166808 [71,] 135.4649 1.2069244 [72,] 135.4498 1.2040823 [73,] 135.4498 1.2040823 [74,] 135.4032 1.1953561 [75,] 135.3874 1.1944301 [76,] 135.3555 1.1864631 [77,] 135.3231 1.1845809 [78,] 135.4050 1.1789594 [79,] 135.3884 1.1779943 [80,] 135.4053 1.1662441 [81,] 135.3882 1.1545913 [82,] 135.4399 1.1489425 [83,] 135.4225 1.1479446 [84,] 135.4225 1.1457450 [85,] 135.3689 1.1426940 [86,] 135.3689 1.1426940 [87,] 135.3689 1.1404221 [88,] 135.4983 1.1202970 [89,] 135.5170 1.1167476 [90,] 135.4603 1.1135499 [91,] 135.4221 1.1020358 [92,] 135.4027 1.0985989 [93,] 135.4418 1.0960033 [94,] 135.4023 1.0914055 [95,] 135.4023 1.0889774 [96,] 135.4628 1.0678804 [97,] 135.5851 1.0574142 [98,] 135.7086 1.0444440 [99,] 135.7918 1.0341049 [100,] 135.7498 1.0218058 [101,] 135.5800 1.0126241 [102,] 135.6443 1.0034413 [103,] 135.6227 1.0022822 [104,] 135.5571 0.9962207 [105,] 135.4910 0.9927148 [106,] 135.4687 0.9915395 [107,] 135.6261 0.9788446 [108,] 135.6261 0.9762011 [109,] 135.6718 0.9706246 [110,] 135.7643 0.9620875 [111,] 135.7876 0.9579132 [112,] 135.7876 0.9579132 [113,] 136.0962 0.9358615 [114,] 136.2878 0.9212749 [115,] 136.2395 0.9187056 [116,] 136.3613 0.9112338 [117,] 136.9758 0.8714744 [118,] 136.9758 0.8686732 [119,] 136.9508 0.8560649 [120,] 136.9256 0.8547178 [121,] 137.0273 0.8458936 [122,] 137.0786 0.8400299 [123,] 137.0786 0.8400299 [124,] 137.1046 0.8385111 [125,] 137.0258 0.8343103 [126,] 137.0258 0.8343103 [127,] 136.9992 0.8299201 [128,] 136.9992 0.8269269 [129,] 137.0263 0.8223354 [130,] 137.0536 0.8177155 [131,] 136.9160 0.8074246 [132,] 136.9992 0.8025929 [133,] 137.2506 0.7819543 [134,] 137.2506 0.7757756 [135,] 137.1372 0.7698401 [136,] 137.0515 0.7653840 [137,] 136.9651 0.7577838 [138,] 136.8492 0.7486865 [139,] 136.6739 0.7397957 [140,] 136.8504 0.7201441 [141,] 136.9689 0.7102089 [142,] 136.9391 0.7055069 [143,] 137.0292 0.6971832 [144,] 137.0595 0.6890147 [145,] 137.1204 0.6823386 [146,] 137.1204 0.6790754 [147,] 137.1513 0.6773416 [148,] 137.1513 0.6740381 [149,] 137.1826 0.6689627 [150,] 137.2141 0.6638609 [151,] 137.3410 0.6567902 [152,] 137.4048 0.6498707 [153,] 137.5655 0.6342220 [154,] 137.6626 0.6254961 [155,] 137.7277 0.6185206 [156,] 137.7933 0.6080896 [157,] 137.9582 0.5888491 [158,] 138.0246 0.5852802 > (tri <- trimean(x)) [,1] [,2] [1,] 136.3747 1.5359732 [2,] 136.3534 1.5264047 [3,] 136.3379 1.5179599 [4,] 136.3214 1.5095024 [5,] 136.3049 1.5009307 [6,] 136.2916 1.4925169 [7,] 136.2786 1.4840122 [8,] 136.2709 1.4760634 [9,] 136.2631 1.4679896 [10,] 136.2564 1.4602058 [11,] 136.2500 1.4523016 [12,] 136.2458 1.4445419 [13,] 136.2400 1.4369460 [14,] 136.2339 1.4296520 [15,] 136.2285 1.4226237 [16,] 136.2239 1.4155815 [17,] 136.2192 1.4084349 [18,] 136.2127 1.4013570 [19,] 136.2078 1.3943345 [20,] 136.2030 1.3872303 [21,] 136.2030 1.3806811 [22,] 136.2021 1.3741289 [23,] 136.2007 1.3675285 [24,] 136.2028 1.3612660 [25,] 136.2038 1.3549403 [26,] 136.2040 1.3485493 [27,] 136.2085 1.3424342 [28,] 136.2131 1.3361424 [29,] 136.2156 1.3298826 [30,] 136.2188 1.3237466 [31,] 136.2217 1.3178326 [32,] 136.2245 1.3119576 [33,] 136.2278 1.3064283 [34,] 136.2309 1.3007582 [35,] 136.2352 1.2950364 [36,] 136.2406 1.2894301 [37,] 136.2473 1.2838208 [38,] 136.2545 1.2784286 [39,] 136.2623 1.2729673 [40,] 136.2692 1.2675377 [41,] 136.2766 1.2620875 [42,] 136.2837 1.2567187 [43,] 136.2918 1.2512793 [44,] 136.3000 1.2457197 [45,] 136.3078 1.2400892 [46,] 136.3138 1.2344670 [47,] 136.3202 1.2286912 [48,] 136.3242 1.2229740 [49,] 136.3280 1.2171535 [50,] 136.3324 1.2112519 [51,] 136.3390 1.2055884 [52,] 136.3462 1.2000640 [53,] 136.3527 1.1944420 [54,] 136.3584 1.1888843 [55,] 136.3702 1.1837251 [56,] 136.3819 1.1784761 [57,] 136.3917 1.1733087 [58,] 136.4033 1.1682921 [59,] 136.4151 1.1631595 [60,] 136.4270 1.1579067 [61,] 136.4270 1.1525539 [62,] 136.4531 1.1472171 [63,] 136.4683 1.1419754 [64,] 136.4836 1.1367256 [65,] 136.4983 1.1316212 [66,] 136.5172 1.1267772 [67,] 136.5365 1.1217848 [68,] 136.5559 1.1166436 [69,] 136.5740 1.1115412 [70,] 136.5955 1.1066810 [71,] 136.6192 1.1018663 [72,] 136.6425 1.0971853 [73,] 136.6664 1.0924168 [74,] 136.6905 1.0874667 [75,] 136.7160 1.0826034 [76,] 136.7420 1.0775812 [77,] 136.7689 1.0726170 [78,] 136.7969 1.0675168 [79,] 136.8236 1.0624035 [80,] 136.8509 1.0571185 [81,] 136.8783 1.0520027 [82,] 136.9064 1.0470527 [83,] 136.9339 1.0420875 [84,] 136.9620 1.0369510 [85,] 136.9905 1.0316759 [86,] 137.0204 1.0262779 [87,] 137.0507 1.0206578 [88,] 137.0813 1.0148792 [89,] 137.1101 1.0095280 [90,] 137.1389 1.0040688 [91,] 137.1690 0.9984772 [92,] 137.2003 0.9930193 [93,] 137.2324 0.9874370 [94,] 137.2642 0.9817033 [95,] 137.2972 0.9758678 [96,] 137.3306 0.9698578 [97,] 137.3635 0.9642923 [98,] 137.3946 0.9588400 [99,] 137.4241 0.9535858 [100,] 137.4525 0.9484440 [101,] 137.4821 0.9434676 [102,] 137.5151 0.9385417 [103,] 137.5474 0.9336961 [104,] 137.5806 0.9286568 [105,] 137.6154 0.9235711 [106,] 137.6519 0.9183494 [107,] 137.6893 0.9129120 [108,] 137.7246 0.9076684 [109,] 137.7605 0.9022585 [110,] 137.7961 0.8967821 [111,] 137.8307 0.8913450 [112,] 137.8655 0.8857859 [113,] 137.9008 0.8799472 [114,] 137.9315 0.8746422 [115,] 137.9593 0.8696056 [116,] 137.9885 0.8643925 [117,] 138.0161 0.8591913 [118,] 138.0337 0.8551847 [119,] 138.0517 0.8510570 [120,] 138.0703 0.8471408 [121,] 138.0897 0.8430506 [122,] 138.0897 0.8390535 [123,] 138.1252 0.8350431 [124,] 138.1430 0.8308035 [125,] 138.1606 0.8263797 [126,] 138.1799 0.8218494 [127,] 138.1995 0.8170579 [128,] 138.2200 0.8121531 [129,] 138.2408 0.8070778 [130,] 138.2616 0.8018875 [131,] 138.2822 0.7965765 [132,] 138.3057 0.7913398 [133,] 138.3281 0.7859933 [134,] 138.3466 0.7811828 [135,] 138.3655 0.7763227 [136,] 138.3868 0.7713849 [137,] 138.4099 0.7663059 [138,] 138.4350 0.7612053 [139,] 138.4626 0.7561361 [140,] 138.4939 0.7510748 [141,] 138.5227 0.7465448 [142,] 138.5500 0.7421491 [143,] 138.5784 0.7376432 [144,] 138.6059 0.7332000 [145,] 138.6333 0.7288036 [146,] 138.6603 0.7243975 [147,] 138.6879 0.7198170 [148,] 138.7156 0.7149880 [149,] 138.7438 0.7099585 [150,] 138.7722 0.7048048 [151,] 138.8006 0.6995198 [152,] 138.8273 0.6942122 [153,] 138.8535 0.6888582 [154,] 138.8774 0.6839058 [155,] 138.9000 0.6790212 [156,] 138.9220 0.6741142 [157,] 138.9432 0.6693584 [158,] 138.9619 0.6652267 > (midr <- midrange(x)) [1] 141.3 > midm <- array(NA,dim=8) > for (j in 1:8) midm[j] <- midmean(x,j) > midm [1] 137.9452 138.0517 137.9452 138.0517 138.0517 137.9452 138.0517 138.0337 > postscript(file="/var/www/html/rcomp/tmp/1i8sz1268944872.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/219dp1268944872.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/32dle1268944872.tab") > > try(system("convert tmp/1i8sz1268944872.ps tmp/1i8sz1268944872.png",intern=TRUE)) character(0) > try(system("convert tmp/219dp1268944872.ps tmp/219dp1268944872.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.842 0.504 3.117