R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" Copyright (C) 2013 The R Foundation for Statistical Computing 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(0.0368357751591943 + ,-1.0190639003189 + ,0.208161805224601 + ,-2.2788665584041 + ,-1.83765123731929 + ,-0.594497904919413 + ,-2.40441267822996 + ,-1.21595267623615 + ,-2.42855507371705 + ,-3.40046057915535 + ,3.15508359674545 + ,-0.373553340482945 + ,-0.76588445023371 + ,3.59973622747415 + ,1.20826233449091 + ,2.19729052091375 + ,1.88934280526474 + ,2.17280299908972 + ,-2.49057504855422 + ,2.71040403630057 + ,-1.27837150075848 + ,-2.58907919835159 + ,2.33984393750344 + ,-1.61763854297886 + ,-1.41555898100296 + ,1.02889904567058 + ,-0.394054833706567 + ,0.233352281093463 + ,-3.92711638592384 + ,1.45998979343389 + ,-0.973155560022386 + ,-1.52676012791688 + ,1.89955118331678 + ,-0.040736703184997 + ,0.0576625757107871 + ,-1.60028866327377 + ,4.07214852767873 + ,5.04197077107892 + ,0.855249323366386 + ,-2.50431948897308 + ,0.985349692364849 + ,2.30658657655433 + ,-1.13894516103742 + ,-1.84272354440752 + ,0.0557831160447392 + ,-0.965219257189205 + ,-0.564485855429203 + ,-3.24658615426235 + ,1.39361817938584 + ,0.689733579138978 + ,-2.98291313364805 + ,-0.16391565029285 + ,-1.43764633595845 + ,1.47720704735019 + ,1.09283275258998 + ,1.1599446416828 + ,0.0297836473745154 + ,-3.38215002809808 + ,3.51255728502302 + ,6.09045932352742 + ,-1.4380607303881 + ,1.75006325639338 + ,-0.332349438530708 + ,1.69912948646031 + ,-3.69496554552662 + ,-0.531908384962639 + ,2.1911882059678 + ,0.0487003845138038 + ,-1.87256490085429 + ,-4.99101230551626 + ,-0.357221175001607 + ,1.87469197406837 + ,-1.18166835073059 + ,-0.905777263556753 + ,0.709398559312217 + ,0.159515296989041 + ,1.00197623088057 + ,-6.36559974139515 + ,3.7143598892987 + ,1.48487549966236 + ,4.4334793256306 + ,1.7739184935925 + ,1.85334592329955 + ,-0.586575199835857 + ,0.35355830052386 + ,-0.292254658764286 + ,-0.449093408053045 + ,1.04832238070239 + ,-0.83014980447115 + ,-1.57666633956783 + ,-0.671277174683842 + ,-1.32123372506703 + ,0.704587394294252 + ,-0.0992291874343332 + ,-4.4351370345664 + ,-0.554395892028946 + ,-1.36263558897174 + ,1.48112688125901 + ,0.664233331749525 + ,0.606327085737559 + ,-1.88955706388571 + ,5.44794503219688 + ,0.516228402681602 + ,4.39239667204198 + ,0.112896158180923 + ,-0.832174815602652 + ,-0.341683212507999 + ,1.25371805660489 + ,0.567385394419931 + ,-0.117886848361801 + ,-2.2158217020701 + ,-0.939483003618944 + ,-2.09063751521921 + ,0.580237595114395 + ,-0.223100991231705 + ,-0.85871704699942 + ,-3.10004394974646 + ,-3.04631733096399 + ,1.10513134894708 + ,-0.622758451182783 + ,4.3520819242433 + ,2.7148117720876 + ,-2.78937709524309 + ,-0.167443488159463 + ,4.1727053002789 + ,0.550963616634063 + ,4.77553501951607 + ,-0.62005022356656 + ,-1.49154398268031 + ,0.415284609604837 + ,-1.10967483726419 + ,-0.528580897611872 + ,1.30444061351816 + ,-2.84707914464274 + ,-0.548677660690404 + ,-0.214451000294082 + ,-0.380683887149735 + ,-0.380189975484037 + ,-0.0727914887853047 + ,-5.5371399058937 + ,1.64649539248047 + ,-1.94185664000441 + ,1.9967570096981 + ,1.56187491212005 + ,2.20944741193416 + ,1.07047843684451 + ,-1.01746525511327 + ,1.95183558863869 + ,2.53600661602191 + ,5.40375256393779 + ,-2.7186263606211 + ,-1.004849040061 + ,0.31863516109105 + ,-0.867981322813375 + ,-2.52171183071327 + ,1.23273845632762 + ,-2.66235702646079 + ,1.80002817124374 + ,-0.661096201572958 + ,-2.41430270585832 + ,-0.310008778693897 + ,-0.833953613503462 + ,-4.82072047348237 + ,0.0712094741764551 + ,6.17039971400764 + ,1.98015384703667 + ,-3.03982009090767 + ,-1.22743346232641 + ,2.60280524958066 + ,4.7800334467633 + ,5.0129325270763 + ,-1.44059479812376 + ,-1.85997051745873 + ,-1.63186522596681 + ,-0.767707465308539 + ,-0.388978803320056 + ,0.46777657817699 + ,-1.08699543059431 + ,0.826370506937159 + ,-0.409566651156072 + ,-3.51070086958119 + ,1.26118373465699 + ,-2.77650796710508 + ,0.349066307576833 + ,0.484546395174079 + ,-2.41225925983822 + ,-1.39975471544014 + ,1.03614929106713 + ,2.50809812165549 + ,3.58439421250938 + ,1.03213368098337 + ,0.781294161759724 + ,0.0290941640710876 + ,2.52911581036576 + ,-0.266524208754152 + ,2.0812332919274 + ,-1.58738810351554 + ,-1.42614655462839 + ,-1.77211327774126 + ,-1.01086560411757 + ,0.991195831369154 + ,1.5315489476354 + ,-3.75766642101972 + ,-1.95779168343568 + ,2.45130315841064 + ,-1.74653903169997 + ,-2.24259910449532 + ,1.70755549542789 + ,-1.92342834740484 + ,1.30741333356524 + ,2.71550198857552 + ,3.42372633213998 + ,-1.43675398327492 + ,2.29355429776156 + ,3.08163264815911 + ,2.07111738238772 + ,0.389782913682394 + ,-4.42017454752259 + ,-0.0326198140592755 + ,-0.594183931742408 + ,-0.890834090821979 + ,0.193681134498324 + ,1.73682305567116 + ,-1.81273878070222 + ,-2.84585207610763 + ,-2.15936849572974 + ,0.0930238264161019 + ,0.654787564364268 + ,-0.775855274352993 + ,-3.02066499499275 + ,2.0334530541507 + ,2.08877131303298 + ,-0.512430662802789 + ,0.739675907928347 + ,3.40716274559129 + ,1.14499291978022 + ,2.10508435215283 + ,1.16885365289879 + ,-1.88926376257524 + ,3.07126868148612 + ,0.526285403668501 + ,-1.07041096537501 + ,-1.47568183434488 + ,-0.176125743115906 + ,-2.59607569113522 + ,-0.350795310865224 + ,-4.40626480760035 + ,2.26826617963964 + ,-2.26532476424654 + ,1.73998689384217 + ,-4.47291404971826 + ,2.67819410391647 + ,-3.22608795077426 + ,1.60686038123645 + ,6.58335638708255 + ,1.34923758808235 + ,0.374037093336989 + ,2.39810745924056 + ,-0.849057400950937 + ,-0.205452468150575 + ,2.50767119399353 + ,0.0510351433973448 + ,-2.35821666225616 + ,0.372539117556919 + ,-3.22625940441536 + ,-0.77417475332925 + ,0.528279380937435 + ,-0.936470813462194 + ,1.71292769694171 + ,-3.91065649823365 + ,-0.0191556056008895 + ,1.14183431087096 + ,-2.05351986514292 + ,-0.0257643217199542 + ,-1.77788563399384 + ,-0.557997953903428 + ,6.62708136410813 + ,1.95570769054546 + ,0.0284509462877964 + ,-1.47443919033645 + ,5.14457941343711 + ,1.23307814116522 + ,-0.608395790847639 + ,1.30135077149576 + ,-5.17191093426233 + ,1.53805619072917 + ,-0.553764717086649 + ,-1.2628395949886 + ,0.93760261638218 + ,-0.852063304012524 + ,-1.4788286112616 + ,-1.85846542972199 + ,-2.63076793231397 + ,3.05051816813332 + ,-3.2689011138175 + ,-0.188349694353825 + ,-1.15999193385793 + ,1.71369201868517 + ,3.3364738373542 + ,-0.808699414767659 + ,5.10011890304847 + ,-1.52187984447781 + ,3.47042679135923 + ,2.4706703275427 + ,-0.229262829123134 + ,-3.21482807374368 + ,1.10463274827445 + ,0.830717865543033 + ,-1.37198279508075 + ,-3.13097190789517 + ,1.08886895934984 + ,-1.69814461608981) > 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] 0.02890754 > sqrtn <- sqrt(length(x)) > (armse <- sd(x) / sqrtn) [1] 0.1273435 > (armose <- arm / armse) [1] 0.2270044 > (geo <- geomean(x)) [1] NaN Warning message: In log(x) : NaNs produced > (har <- harmean(x)) [1] 55.67599 > (qua <- quamean(x)) [1] 2.245913 > (win <- winmean(x)) [,1] [,2] [1,] 0.0314227119 0.12691846 [2,] 0.0311167651 0.12617124 [3,] 0.0320875174 0.12582464 [4,] 0.0260333833 0.12433213 [5,] 0.0308989915 0.12355693 [6,] 0.0266413736 0.12278943 [7,] 0.0259795589 0.12261704 [8,] 0.0248452412 0.12237802 [9,] 0.0378291886 0.12073246 [10,] 0.0308920350 0.11970593 [11,] 0.0361273175 0.11912393 [12,] 0.0253829014 0.11724029 [13,] 0.0313488190 0.11626578 [14,] 0.0344865036 0.11556936 [15,] 0.0267429425 0.11446490 [16,] 0.0273938215 0.11331897 [17,] 0.0091148070 0.11103949 [18,] 0.0036746005 0.11022732 [19,] 0.0027507522 0.11012848 [20,] -0.0011323920 0.10958225 [21,] 0.0016760667 0.10876317 [22,] 0.0005639031 0.10822543 [23,] 0.0033034856 0.10773865 [24,] -0.0016343350 0.10714455 [25,] -0.0146339460 0.10557454 [26,] -0.0176088699 0.10470052 [27,] -0.0067508872 0.10356133 [28,] -0.0085029912 0.10337403 [29,] -0.0343930385 0.10005085 [30,] -0.0332219893 0.09993559 [31,] -0.0279088804 0.09939271 [32,] -0.0254412494 0.09860142 [33,] -0.0300739164 0.09761734 [34,] -0.0335726899 0.09666753 [35,] -0.0335608340 0.09653465 [36,] -0.0282127941 0.09567122 [37,] -0.0262008700 0.09549442 [38,] -0.0290333834 0.09497188 [39,] -0.0237017827 0.09412558 [40,] -0.0286945175 0.09340229 [41,] -0.0360824121 0.09274502 [42,] -0.0395030939 0.09229064 [43,] -0.0349324506 0.09162199 [44,] -0.0273083244 0.09042650 [45,] -0.0338386572 0.08958229 [46,] -0.0322804413 0.08917036 [47,] -0.0291659249 0.08877596 [48,] -0.0233093096 0.08786516 [49,] -0.0231503213 0.08617719 [50,] -0.0198162490 0.08551287 [51,] -0.0054005497 0.08423343 [52,] -0.0044306940 0.08390166 [53,] -0.0076983539 0.08316257 [54,] -0.0081872549 0.08223021 [55,] -0.0110623907 0.08199741 [56,] -0.0124529308 0.08143516 [57,] -0.0108594370 0.08121147 [58,] -0.0202991820 0.08044033 [59,] -0.0192527816 0.08007393 [60,] -0.0210948054 0.07978691 [61,] -0.0203975274 0.07911287 [62,] -0.0240667759 0.07780678 [63,] -0.0281733504 0.07732602 [64,] -0.0278207332 0.07658052 [65,] -0.0198378055 0.07570053 [66,] -0.0064864387 0.07465985 [67,] -0.0083985916 0.07407408 [68,] -0.0047837905 0.07379811 [69,] -0.0031188652 0.07351118 [70,] -0.0026037919 0.07320330 [71,] -0.0032245600 0.07152993 [72,] -0.0112448818 0.07077737 [73,] -0.0146725143 0.06952075 [74,] -0.0173060012 0.06890391 [75,] -0.0181138055 0.06873887 [76,] -0.0291802834 0.06789850 [77,] -0.0217528008 0.06726299 [78,] -0.0220992423 0.06714965 [79,] -0.0263538125 0.06683016 [80,] -0.0431433667 0.06560678 [81,] -0.0519113993 0.06461116 [82,] -0.0601210398 0.06365784 [83,] -0.0567075197 0.06331589 [84,] -0.0500623448 0.06275010 [85,] -0.0584587730 0.06182303 [86,] -0.0491045679 0.06091139 [87,] -0.0429079626 0.05971688 [88,] -0.0386229772 0.05941947 [89,] -0.0355051215 0.05827301 [90,] -0.0435612452 0.05727815 [91,] -0.0361601119 0.05644586 [92,] -0.0341771890 0.05572954 [93,] -0.0288451402 0.05525907 [94,] -0.0310844606 0.05393958 [95,] -0.0243306896 0.05348670 [96,] -0.0228585451 0.05291500 [97,] -0.0081272074 0.05182246 [98,] -0.0134015791 0.05139851 [99,] -0.0183377461 0.05079122 [100,] -0.0203109915 0.05040688 [101,] -0.0113511682 0.04967764 [102,] -0.0098140846 0.04944485 [103,] -0.0102058019 0.04831866 [104,] -0.0127952050 0.04801474 > (tri <- trimean(x)) [,1] [,2] [1,] 0.0282505472 0.12468062 [2,] 0.0250371855 0.12233599 [3,] 0.0219377920 0.12028563 [4,] 0.0184655176 0.11826787 [5,] 0.0165109033 0.11658280 [6,] 0.0135181809 0.11500177 [7,] 0.0112282278 0.11350213 [8,] 0.0090069849 0.11196530 [9,] 0.0069059918 0.11039603 [10,] 0.0032347446 0.10898617 [11,] 0.0002592017 0.10764574 [12,] -0.0032732643 0.10631372 [13,] -0.0058783702 0.10513226 [14,] -0.0090243299 0.10399869 [15,] -0.0124628760 0.10288224 [16,] -0.0153753083 0.10181937 [17,] -0.0183753012 0.10081020 [18,] -0.0202032879 0.09994946 [19,] -0.0217138112 0.09911574 [20,] -0.0231907741 0.09825210 [21,] -0.0244652584 0.09739047 [22,] -0.0259144576 0.09654893 [23,] -0.0273261542 0.09570671 [24,] -0.0289000092 0.09485875 [25,] -0.0302528862 0.09401140 [26,] -0.0310025953 0.09322784 [27,] -0.0316255593 0.09246313 [28,] -0.0327483744 0.09173266 [29,] -0.0338120076 0.09097857 [30,] -0.0337872017 0.09038651 [31,] -0.0337872017 0.08977203 [32,] -0.0340502270 0.08915817 [33,] -0.0343914365 0.08855819 [34,] -0.0345587324 0.08798250 [35,] -0.0345961224 0.08742920 [36,] -0.0346345760 0.08685456 [37,] -0.0348684224 0.08629610 [38,] -0.0351781196 0.08571770 [39,] -0.0353937244 0.08513626 [40,] -0.0357968948 0.08456779 [41,] -0.0360377580 0.08400608 [42,] -0.0360362676 0.08344749 [43,] -0.0359223138 0.08288137 [44,] -0.0359543775 0.08231777 [45,] -0.0359543775 0.08178252 [46,] -0.0363059219 0.08125896 [47,] -0.0364311663 0.08072578 [48,] -0.0366544479 0.08018131 [49,] -0.0370597909 0.07964990 [50,] -0.0374775570 0.07916941 [51,] -0.0380023502 0.07869198 [52,] -0.0389612266 0.07824616 [53,] -0.0399669703 0.07778837 [54,] -0.0408981402 0.07733742 [55,] -0.0418337650 0.07690228 [56,] -0.0427065531 0.07645030 [57,] -0.0435578455 0.07599598 [58,] -0.0444710127 0.07552255 [59,] -0.0451412590 0.07505564 [60,] -0.0458542891 0.07457526 [61,] -0.0465319170 0.07407672 [62,] -0.0465319170 0.07357745 [63,] -0.0478699673 0.07310810 [64,] -0.0484001040 0.07262972 [65,] -0.0489513371 0.07215433 [66,] -0.0497276980 0.07168798 [67,] -0.0508760869 0.07123811 [68,] -0.0519999826 0.07078413 [69,] -0.0532450343 0.07030966 [70,] -0.0545628103 0.06981386 [71,] -0.0559250971 0.06929630 [72,] -0.0573035820 0.06882525 [73,] -0.0585059175 0.06835688 [74,] -0.0596482515 0.06791634 [75,] -0.0607502520 0.06747209 [76,] -0.0618587996 0.06700002 [77,] -0.0627078750 0.06653454 [78,] -0.0637716431 0.06606328 [79,] -0.0648540431 0.06555823 [80,] -0.0658543822 0.06502836 [81,] -0.0664448686 0.06452281 [82,] -0.0668231171 0.06402937 [83,] -0.0669977787 0.06354612 [84,] -0.0672663999 0.06303854 [85,] -0.0672663999 0.06251730 [86,] -0.0679591265 0.06200299 [87,] -0.0684547974 0.06149427 [88,] -0.0691284461 0.06100820 [89,] -0.0699355786 0.06049215 [90,] -0.0699355786 0.05999573 [91,] -0.0715776722 0.05951210 [92,] -0.0725263568 0.05903020 [93,] -0.0735585291 0.05854317 [94,] -0.0747682565 0.05803384 [95,] -0.0747682565 0.05755733 [96,] -0.0773696470 0.05705666 [97,] -0.0788710121 0.05653847 [98,] -0.0808326249 0.05603344 [99,] -0.0827157690 0.05550086 [100,] -0.0845272718 0.05495108 [101,] -0.0863486791 0.05436468 [102,] -0.0884938224 0.05376025 [103,] -0.0907642699 0.05309891 [104,] -0.0931106330 0.05244756 > (midr <- midrange(x)) [1] 0.1307408 > midm <- array(NA,dim=8) > for (j in 1:8) midm[j] <- midmean(x,j) > midm [1] -0.07254122 -0.06377164 -0.07254122 -0.06377164 -0.06377164 -0.07254122 [7] -0.06377164 -0.06270787 > postscript(file="/var/fisher/rcomp/tmp/1tdk11386183860.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/fisher/rcomp/tmp/2l3ug1386183860.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/fisher/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/fisher/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/fisher/rcomp/tmp/3j2be1386183860.tab") > > try(system("convert tmp/1tdk11386183860.ps tmp/1tdk11386183860.png",intern=TRUE)) character(0) > try(system("convert tmp/2l3ug1386183860.ps tmp/2l3ug1386183860.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.490 0.785 5.243