R version 2.15.2 (2012-10-26) -- "Trick or Treat" Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i686-pc-linux-gnu (32-bit) 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(-2.8383455253 + ,-6.8876476771 + ,-7.4106697959 + ,21.5609086781 + ,-14.7163972633 + ,-8.9731065875 + ,-21.3856911445 + ,-12.92515467 + ,29.2447935282 + ,3.2344204049 + ,-35.2373838504 + ,-27.1792379163 + ,5.6337793547 + ,-17.4188046701 + ,1.57717113 + ,14.7492731318 + ,-8.6464544896 + ,-28.2505458756 + ,11.8466034378 + ,-4.2815086526 + ,-19.5294728073 + ,-9.7870674112 + ,3.9260353751 + ,-10.6842063204 + ,5.2482378668 + ,-8.2496164978 + ,11.8185907956 + ,13.5347210251 + ,-8.3055882213 + ,-11.4457118176 + ,-29.7146224435 + ,-2.9525507815 + ,11.8343015352 + ,-14.580699983 + ,17.468430382 + ,-18.3658451479 + ,-12.4496913271 + ,14.4134668292 + ,14.7736363482 + ,28.5434853104 + ,5.6047909046 + ,-20.0055017819 + ,-11.8235293595 + ,13.2232096387 + ,42.9217520606 + ,15.1990682348 + ,5.4721970806 + ,-1.235261552 + ,6.2473801417 + ,2.6208358575 + ,-4.731176187 + ,34.2228181964 + ,-15.9938460107 + ,13.4948790191 + ,8.5358919008 + ,-38.9718418159 + ,9.3537516169 + ,-0.9476791512 + ,29.4611346487 + ,-20.0530302742 + ,5.187887602 + ,1.0711050037 + ,15.2581910924 + ,10.1549289227 + ,-24.470923332 + ,27.0065923012 + ,7.1923091618 + ,13.2445018346 + ,12.1883858068 + ,-29.4688903527 + ,6.8485379664 + ,15.2470262084 + ,18.1806960883 + ,18.6627589331 + ,15.5690757884 + ,-3.8188078036 + ,13.4365678512 + ,-10.7144988358 + ,17.2186220641 + ,1.8802105698 + ,24.7921510147 + ,-13.5084923467 + ,23.966532712 + ,26.9724458943 + ,11.1740372181 + ,-2.4950325527 + ,-21.2665295414 + ,-13.0130569535 + ,10.579067621 + ,-15.5669323549 + ,0.7161494212 + ,26.6346510236 + ,3.7208761669 + ,-27.9710694652 + ,-0.0648377608 + ,-9.1023753862 + ,-14.1195227024 + ,-0.9888045718 + ,23.994963672 + ,6.1141151687 + ,18.8590831063 + ,-6.2679218578 + ,33.654771004 + ,-11.8338248695 + ,-66.1273159327 + ,-14.8034081555 + ,4.7257859336 + ,35.0184266599 + ,41.5978086796 + ,-50.0753579077 + ,-50.4927006049 + ,-44.4856366272 + ,0.0336439267 + ,-5.0427554882 + ,9.8664792844 + ,-30.5456405658 + ,30.510595308 + ,32.9930138008 + ,4.9380784794 + ,-17.486826193 + ,-29.1683681672 + ,2.5726588033 + ,15.9187027322 + ,-7.4464242839 + ,-37.0097494808 + ,12.1802755329 + ,-24.857269276 + ,0.8353015574 + ,8.7395262687 + ,37.1026630382 + ,-28.3412120096 + ,28.0745111985 + ,-4.4937418387 + ,6.7722682701 + ,17.3390204789 + ,-1.9768117774 + ,-4.7802133527 + ,-9.6924338679 + ,5.2322440793 + ,-6.1785460882 + ,14.5541593128 + ,9.4626062006 + ,-7.1795635107 + ,23.139950353 + ,-15.3692470207 + ,0.6380593989 + ,-0.1913211067 + ,8.393052097 + ,-2.7043425142 + ,19.3025817229 + ,11.8590522423 + ,13.737435535 + ,-32.976809998 + ,8.9321765586 + ,-23.4072121248 + ,29.1797829312 + ,-6.4315902457 + ,-33.6187541773 + ,-12.7532638124 + ,17.900629555 + ,-28.6638737224 + ,-7.9134852185 + ,0.5440465541 + ,1.5308076778 + ,-9.9445935911 + ,24.2138934862 + ,34.2585254263 + ,-21.6496089751 + ,21.8993054602 + ,-64.3898034075 + ,3.8566750666 + ,22.0351854485 + ,-41.4050648243 + ,-28.600778474 + ,-1.7926413646 + ,-23.0791094171 + ,44.2911962949 + ,-34.4859128744 + ,15.9985201915 + ,-13.0489016616 + ,24.6440844032 + ,8.4955651609 + ,23.7684747276 + ,2.5890443113 + ,27.7934097507 + ,4.4967994243 + ,5.171841539 + ,-46.4502832315 + ,-1.0057205665 + ,-21.0381984609 + ,0.9399927234 + ,13.5110981027 + ,12.6978693833 + ,19.9779995145 + ,30.217075069 + ,-23.2973535559 + ,-37.1214968815 + ,-1.3331763845 + ,8.6701470333 + ,-17.857403047 + ,1.1282704284 + ,17.2453755416 + ,21.0867167816 + ,2.929145428 + ,6.8033064931 + ,-32.4708151229 + ,19.3329284734 + ,43.7845158826 + ,-23.5864717383 + ,-31.6624837326 + ,5.1618724628 + ,-7.5894285805 + ,-46.6677640237 + ,-6.4590214655 + ,8.6433795337 + ,27.5144187137 + ,2.7080226974 + ,-0.8711790688 + ,-38.3967541283 + ,-40.8912582438 + ,24.0155339282 + ,110.9616414718 + ,5.9051934629 + ,-36.6386140834 + ,-21.0086524619 + ,-21.8505511409 + ,52.5971924268 + ,19.3857309698 + ,33.592904279 + ,1.0945412587 + ,5.8081517202 + ,-12.6016245649 + ,48.2523678578 + ,-45.1149045784 + ,-19.4985759372 + ,26.0414455706 + ,-24.6417039855 + ,-40.4089848418 + ,36.0058194456 + ,1.6296105786 + ,-7.7212461123 + ,-10.7484313744 + ,12.9541166185 + ,-12.8221559942 + ,48.5900401558 + ,-37.6556594764 + ,-9.9746259919 + ,7.5428874735 + ,23.8640277893 + ,18.2360952313 + ,49.0302087067 + ,-12.020615523 + ,-38.1531654177 + ,37.8849583281 + ,-36.9571423385 + ,-18.5873987221 + ,-18.2247924757 + ,7.7544651181 + ,0.3562041314 + ,-11.0810827941 + ,36.1855810186 + ,-17.1381672207 + ,-14.1659765118 + ,-13.647508575 + ,-24.1415952183 + ,4.538750917 + ,12.2560450727 + ,2.144174854 + ,-6.6478122338) > ylimmax = '' > ylimmin = '' > main = 'Robustness of Central Tendency' > #'GNU S' R Code compiled by R2WASP v. 1.2.291 () > #Author: root > #To cite this work: Wessa, P., (2012), Central Tendency (v1.0.4) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_centraltendency.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > # > 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] 7.433855e-13 > sqrtn <- sqrt(length(x)) > (armse <- sd(x) / sqrtn) [1] 1.398587 > (armose <- arm / armse) [1] 5.315262e-13 > (geo <- geomean(x)) [1] NaN Warning message: In log(x) : NaNs produced > (har <- harmean(x)) [1] 13.14649 > (qua <- quamean(x)) [1] 22.89585 > (win <- winmean(x)) [,1] [,2] [1,] -0.210509058 1.3491919 [2,] -0.133705198 1.3289354 [3,] -0.133959762 1.3276047 [4,] -0.088310370 1.3200253 [5,] -0.157895700 1.3097991 [6,] -0.139411725 1.3044936 [7,] -0.145487826 1.2995995 [8,] -0.093246088 1.2834432 [9,] -0.200277292 1.2668816 [10,] -0.211430522 1.2615054 [11,] -0.190164087 1.2505061 [12,] -0.172528721 1.2466849 [13,] -0.208474643 1.2402272 [14,] -0.222130904 1.2331238 [15,] -0.194335995 1.2295600 [16,] -0.221476503 1.2253080 [17,] -0.222061681 1.2245326 [18,] -0.240888893 1.2180399 [19,] -0.317255350 1.1896939 [20,] -0.283206968 1.1815105 [21,] -0.274524501 1.1686064 [22,] -0.239716815 1.1613724 [23,] -0.202011840 1.1563179 [24,] -0.186663102 1.1435067 [25,] -0.126452223 1.1288831 [26,] -0.073300426 1.1183436 [27,] -0.076638684 1.1133125 [28,] -0.098216820 1.1053746 [29,] -0.047510154 1.0997284 [30,] -0.078145799 1.0956045 [31,] -0.116594902 1.0865215 [32,] -0.254424306 1.0723207 [33,] -0.238303401 1.0674073 [34,] -0.192594176 1.0530544 [35,] 0.083711838 1.0226098 [36,] 0.109807828 1.0197502 [37,] 0.129387526 1.0172849 [38,] 0.161429464 1.0118353 [39,] 0.228058632 1.0034533 [40,] 0.161253463 0.9929667 [41,] 0.009613464 0.9771275 [42,] 0.022473294 0.9723178 [43,] 0.164766767 0.9505823 [44,] 0.120071644 0.9412632 [45,] -0.021251682 0.9222362 [46,] -0.102154728 0.9123395 [47,] -0.071486165 0.9081591 [48,] -0.071629050 0.9072734 [49,] 0.021657400 0.8859957 [50,] -0.005999790 0.8823608 [51,] 0.003359426 0.8683948 [52,] -0.001377073 0.8670552 [53,] 0.122968154 0.8478128 [54,] 0.080682420 0.8373983 [55,] 0.083062912 0.8329828 [56,] 0.140050613 0.8252272 [57,] 0.212905381 0.8184248 [58,] -0.035498561 0.7971620 [59,] 0.008547459 0.7908540 [60,] 0.185802686 0.7645944 [61,] 0.212114086 0.7517019 [62,] 0.255103929 0.7479494 [63,] 0.376392019 0.7368493 [64,] 0.295875500 0.7277008 [65,] 0.322777783 0.7247437 [66,] 0.376659705 0.7134171 [67,] 0.353187619 0.7099430 [68,] 0.301614506 0.6883545 [69,] 0.285275542 0.6818821 [70,] 0.398724402 0.6724596 [71,] 0.403904399 0.6714424 [72,] 0.411824698 0.6685547 [73,] 0.387654007 0.6626938 [74,] 0.400748427 0.6608611 [75,] 0.368001093 0.6523061 [76,] 0.338529480 0.6439246 [77,] 0.334880279 0.6258257 [78,] 0.369423953 0.6204487 [79,] 0.370065714 0.6200576 [80,] 0.386896718 0.6050611 [81,] 0.492943550 0.5968168 [82,] 0.590596562 0.5892406 [83,] 0.596218902 0.5881439 [84,] 0.404405038 0.5732419 [85,] 0.440620325 0.5440115 [86,] 0.314623516 0.5339469 [87,] 0.272280242 0.5239004 [88,] 0.171116377 0.5126984 [89,] 0.330325102 0.4963287 > (tri <- trimean(x)) [,1] [,2] [1,] -0.167918822 1.3230556 [2,] -0.124685715 1.2954885 [3,] -0.120073090 1.2775286 [4,] -0.115302318 1.2591653 [5,] -0.122310845 1.2420486 [6,] -0.114861563 1.2264713 [7,] -0.110545228 1.2111765 [8,] -0.105237741 1.1959719 [9,] -0.106844193 1.1825322 [10,] -0.095628885 1.1707569 [11,] -0.083017290 1.1590878 [12,] -0.072322489 1.1481510 [13,] -0.063078499 1.1370900 [14,] -0.050594757 1.1261463 [15,] -0.036804194 1.1153514 [16,] -0.024884066 1.1043389 [17,] -0.010819341 1.0931387 [18,] 0.003526579 1.0814141 [19,] 0.019338931 1.0696181 [20,] 0.040148828 1.0595199 [21,] 0.059308015 1.0495269 [22,] 0.078313507 1.0399818 [23,] 0.095751370 1.0304552 [24,] 0.111509446 1.0207718 [25,] 0.126769799 1.0114631 [26,] 0.139325878 1.0026516 [27,] 0.149557805 0.9940584 [28,] 0.160138027 0.9853067 [29,] 0.171901306 0.9765686 [30,] 0.181639251 0.9676880 [31,] 0.192892420 0.9585450 [32,] 0.205992670 0.9494323 [33,] 0.225058582 0.9406513 [34,] 0.243850136 0.9316404 [35,] 0.261202119 0.9229641 [36,] 0.268126686 0.9156077 [37,] 0.274193320 0.9079555 [38,] 0.279648124 0.8999610 [39,] 0.284029610 0.8917758 [40,] 0.286072235 0.8835561 [41,] 0.290561039 0.8754134 [42,] 0.300524769 0.8676505 [43,] 0.310256209 0.8596448 [44,] 0.315284689 0.8523624 [45,] 0.321952072 0.8451095 [46,] 0.333543009 0.8384260 [47,] 0.348102349 0.8318173 [48,] 0.361983706 0.8249686 [49,] 0.376194455 0.8176681 [50,] 0.387711237 0.8110574 [51,] 0.400394861 0.8041531 [52,] 0.413086785 0.7975256 [53,] 0.426240486 0.7904614 [54,] 0.435801046 0.7839707 [55,] 0.446926939 0.7775593 [56,] 0.458262135 0.7708855 [57,] 0.468123760 0.7641266 [58,] 0.475995993 0.7572171 [59,] 0.491706433 0.7509600 [60,] 0.506490844 0.7445437 [61,] 0.516271470 0.7391393 [62,] 0.525521706 0.7340012 [63,] 0.533726350 0.7286096 [64,] 0.538490837 0.7233822 [65,] 0.545827115 0.7181976 [66,] 0.552564933 0.7126889 [67,] 0.557875652 0.7073407 [68,] 0.564054653 0.7016717 [69,] 0.571979709 0.6967781 [70,] 0.580644289 0.6917705 [71,] 0.586148951 0.6868338 [72,] 0.591672758 0.6814224 [73,] 0.597135622 0.6756122 [74,] 0.603515171 0.6695605 [75,] 0.609709159 0.6629670 [76,] 0.617118785 0.6562450 [77,] 0.625693215 0.6493668 [78,] 0.634683984 0.6430231 [79,] 0.642925489 0.6363302 [80,] 0.651449386 0.6288656 [81,] 0.659763016 0.6216809 [82,] 0.665039258 0.6142792 [83,] 0.667410212 0.6065761 [84,] 0.669694653 0.5979853 [85,] 0.678276051 0.5895716 [86,] 0.686029767 0.5826132 [87,] 0.698258443 0.5755531 [88,] 0.712420862 0.5683883 [89,] 0.730604042 0.5611877 > (midr <- midrange(x)) [1] 22.41716 > midm <- array(NA,dim=8) > for (j in 1:8) midm[j] <- midmean(x,j) > midm [1] 0.4544757 0.5578757 0.5578757 0.5578757 0.5578757 0.4496120 0.5578757 [8] 0.5578757 > postscript(file="/var/wessaorg/rcomp/tmp/1e1pu1355751458.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/21ymq1355751458.ps",horizontal=F,onefile=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/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/wessaorg/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/wessaorg/rcomp/tmp/39cez1355751459.tab") > > try(system("convert tmp/1e1pu1355751458.ps tmp/1e1pu1355751458.png",intern=TRUE)) character(0) > try(system("convert tmp/21ymq1355751458.ps tmp/21ymq1355751458.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.463 0.342 2.783