R version 2.13.0 (2011-04-13) Copyright (C) 2011 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-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(60.10550214 + ,7.907312589 + ,-1.629491887 + ,-1.523957559 + ,-1.566427607 + ,-3.789554566 + ,54.20045707 + ,-32.16351067 + ,-30.40201438 + ,33.72364604 + ,-53.2955719 + ,-14.10459876 + ,7.823650372 + ,-23.49215746 + ,-39.2028498 + ,-54.43872655 + ,-63.16011811 + ,-14.48551331 + ,-6.628558772 + ,-37.25105015 + ,7.170462889 + ,-12.46758139 + ,23.64266832 + ,-1.088791886 + ,-51.66232599 + ,-35.51225152 + ,5.730258769 + ,-4.402113954 + ,-19.40144052 + ,1.520637597 + ,20.30163433 + ,21.12955258 + ,32.29904179 + ,25.40552028 + ,16.24981763 + ,-24.01715407 + ,-24.78162095 + ,-15.62285832 + ,-11.7649527 + ,15.38561447 + ,-5.431603724 + ,-13.87858904 + ,24.54411739 + ,28.99996347 + ,1.823381546 + ,9.40807037 + ,3.02766433 + ,-4.924275934 + ,-9.914609211 + ,-41.1941808 + ,4.53720024 + ,23.27021816 + ,-20.07493513 + ,-20.50904212 + ,10.75962612 + ,24.26947184 + ,35.926565 + ,32.31832443 + ,37.87292367 + ,36.11026854 + ,50.36758637 + ,19.67453788 + ,10.76962171 + ,-6.487800001 + ,-27.56623604 + ,-51.73336757 + ,-6.992290363 + ,8.946225886 + ,8.880187827 + ,-23.81050949 + ,-0.278862806 + ,-15.45329839 + ,-10.46707547 + ,-30.76738602 + ,-18.4731603 + ,8.49149931 + ,-40.76891081 + ,-21.23309141 + ,-22.88154211 + ,22.78833226 + ,3.887467605 + ,34.55711023 + ,16.98614046 + ,10.87706455 + ,-23.9730692 + ,-13.36548015 + ,12.48543861 + ,-15.17381674 + ,21.21318298 + ,0.785421269 + ,-19.0081827 + ,-25.50885618 + ,-0.093813158 + ,16.88835812 + ,43.70886485 + ,14.54204417 + ,-11.24011184 + ,-29.36919552 + ,-20.59868563 + ,4.577397674 + ,11.02976021 + ,14.73668508 + ,-23.53186617 + ,-4.921531948 + ,15.32662923 + ,29.08926135 + ,54.29459094 + ,31.1167715 + ,48.84850449 + ,50.65478883 + ,6.259586477 + ,0.125927575 + ,-29.31237719 + ,-14.21277469 + ,-16.32189997 + ,-34.78923297 + ,-53.29880068 + ,-14.12347214 + ,-19.90407811 + ,34.58381 + ,-2.725432413 + ,-14.15412347 + ,-30.48633561 + ,-56.72239165 + ,-17.0975672 + ,6.781804301 + ,-4.199191315 + ,5.918149191 + ,5.25602161 + ,29.79753421 + ,28.09906023 + ,-5.180180836 + ,-0.795121168 + ,-34.21814225 + ,41.41616426 + ,-24.53373037 + ,-19.73055799 + ,35.12807758 + ,-13.57646513 + ,8.648082867 + ,-21.86253434 + ,39.64458697 + ,30.12676609 + ,59.36691214 + ,28.053251 + ,21.59455656 + ,-23.98495385 + ,-29.9091508 + ,-27.27603939 + ,4.602911543 + ,-22.20718116 + ,-34.74373959 + ,-26.16470221 + ,-10.14232952 + ,-8.798035531 + ,13.88442582 + ,4.869115946 + ,-17.87680942 + ,-4.530999113 + ,-8.675883255 + ,14.55306997 + ,-25.44449318 + ,-18.50374634 + ,28.66893951 + ,-12.84276889 + ,-12.67393586 + ,35.06557157 + ,10.49191107 + ,34.79982181 + ,26.38257706 + ,-31.45029558 + ,-13.35001012 + ,-4.946762703 + ,10.21476321 + ,-20.15173861 + ,-21.20038415 + ,-3.841962139 + ,2.477180829 + ,26.11751198 + ,1.306201076 + ,15.97634906 + ,-4.291690399 + ,-5.682394151 + ,-5.665764694 + ,-30.33249894 + ,38.72973336 + ,-47.83799729 + ,3.321940198 + ,-2.614714535 + ,3.49949132 + ,-10.99473505 + ,18.50568774 + ,-1.727214315 + ,27.73450665 + ,-23.84359408 + ,12.45671351 + ,-20.97058732 + ,22.35504081 + ,-21.66905351 + ,-14.58415028 + ,-6.948261888 + ,-3.844300735 + ,-2.59217522 + ,-2.606079634 + ,-7.148573089 + ,-11.13393188 + ,18.46379055 + ,10.43160614 + ,20.11139491 + ,17.58581713 + ,-7.287709889 + ,-10.7197948 + ,-7.889017956 + ,4.236220473 + ,-9.492926942 + ,14.09899982 + ,-2.34044558 + ,3.813803754 + ,2.058393513 + ,4.052997857 + ,-10.84486214 + ,50.85301232 + ,15.26459505 + ,-18.23151253 + ,14.85770993 + ,10.89175042 + ,-27.68453143 + ,-22.29690237 + ,-20.44825625 + ,19.04978441 + ,-9.4606364 + ,-13.03262134 + ,-8.549005941 + ,57.14094505 + ,19.42414221 + ,-26.830983 + ,-2.375789423 + ,-4.841984246 + ,-10.43034331 + ,-16.68559727 + ,-8.535389247 + ,-1.011460964 + ,11.53032044 + ,13.99524819 + ,-12.32282547 + ,24.04205803 + ,39.9670596 + ,-4.531480962 + ,20.7906344 + ,-6.631809057 + ,-32.68308853 + ,-13.21395321 + ,21.01063002 + ,32.21971589 + ,19.9623395 + ,10.71701444 + ,-7.987055179 + ,32.44259219 + ,36.68680626 + ,-3.434985113 + ,8.795770356 + ,-2.177042793 + ,12.91334573 + ,-7.731531394 + ,7.113072823 + ,-16.18256909 + ,-11.52007059 + ,-26.20538727 + ,-25.19728232 + ,5.070944864 + ,33.52127777 + ,5.463100605 + ,-19.94859926 + ,-25.52969909 + ,1.531601016 + ,-16.26785657 + ,6.819238577 + ,-13.62194833 + ,0.640501845 + ,-21.43841952 + ,-25.58637762 + ,3.756990401 + ,24.51664386 + ,8.509497666 + ,-8.870562774 + ,-10.81810414 + ,-41.87914873 + ,-16.88916034 + ,-9.794453731 + ,14.50000232 + ,-5.710688022 + ,4.477170449 + ,-19.49729592 + ,0.746187934 + ,20.6244016 + ,11.72115378 + ,13.53150503 + ,-26.30984436 + ,13.4761587 + ,2.534010682 + ,29.75308045 + ,9.046961144 + ,-12.28707696 + ,-12.52312942 + ,1.327508167 + ,16.34705721 + ,33.44942405 + ,6.395776893 + ,43.77725734 + ,1.295681207 + ,38.13543152 + ,39.45947974 + ,131.1835976 + ,7.175545616 + ,15.29262607 + ,-37.51868459 + ,-26.9732629 + ,-35.78605184 + ,-14.02307026 + ,-20.98177136 + ,-23.40880757 + ,-18.87758602 + ,-38.70870299 + ,-15.78327673 + ,5.956315672 + ,-7.058043321 + ,-29.81424974 + ,-29.32459991 + ,-50.01675318 + ,20.36062354 + ,33.10653257 + ,23.529991 + ,-20.73256947 + ,-2.54691081 + ,0.941329873 + ,-12.59133006 + ,-7.624749328 + ,38.25746696 + ,-22.40606241 + ,-61.80418462 + ,-30.86857894 + ,10.9344688 + ,-10.12628633 + ,31.92576258 + ,-10.20764808 + ,-1.090251191 + ,-8.301356733 + ,-45.95600614 + ,13.52467186 + ,-1.020698594 + ,18.50984418 + ,-24.78426967 + ,-7.76045319 + ,-32.81723616 + ,54.03872637 + ,3.627317146 + ,13.02541769 + ,-9.993761806 + ,-2.366689948 + ,17.78223915) > 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] -0.6473912 > sqrtn <- sqrt(length(x)) > (armse <- sd(x) / sqrtn) [1] 1.281174 > (armose <- arm / armse) [1] -0.5053111 > (geo <- geomean(x)) [1] NaN Warning message: In log(x) : NaNs produced > (har <- harmean(x)) [1] -43.86728 > (qua <- quamean(x)) [1] 24.28341 > (win <- winmean(x)) [,1] [,2] [1,] -0.8410639 1.2385834 [2,] -0.8169350 1.2343069 [3,] -0.8164542 1.2294727 [4,] -0.8354145 1.2238864 [5,] -0.8366771 1.2237171 [6,] -0.8133358 1.2203118 [7,] -0.8738989 1.2125921 [8,] -0.8417356 1.2078620 [9,] -0.7944468 1.2009491 [10,] -0.7843659 1.1903793 [11,] -0.8147501 1.1603488 [12,] -0.7941976 1.1578698 [13,] -0.8616326 1.1476994 [14,] -0.8570843 1.1361751 [15,] -0.8499312 1.1329077 [16,] -0.8052684 1.1272279 [17,] -0.8270904 1.1226780 [18,] -0.7774538 1.1138499 [19,] -0.7694440 1.1119603 [20,] -0.7438601 1.1070727 [21,] -0.8103965 1.1001990 [22,] -0.8135095 1.0941249 [23,] -0.7357438 1.0855309 [24,] -0.7800331 1.0798253 [25,] -0.7482920 1.0764718 [26,] -0.7159750 1.0705422 [27,] -0.6885472 1.0655812 [28,] -0.6827533 1.0647696 [29,] -0.7272533 1.0568475 [30,] -0.7370905 1.0547682 [31,] -0.7372919 1.0537401 [32,] -0.7301402 1.0480611 [33,] -0.7823021 1.0419466 [34,] -0.7520056 1.0376587 [35,] -0.7495446 1.0371594 [36,] -0.7562549 1.0363620 [37,] -0.6191604 1.0210831 [38,] -0.6920672 1.0126337 [39,] -0.7678798 1.0010094 [40,] -0.7708193 0.9953981 [41,] -0.7596780 0.9937789 [42,] -0.7763241 0.9827673 [43,] -0.7745134 0.9809630 [44,] -0.8099992 0.9771936 [45,] -0.8089436 0.9660367 [46,] -0.8075547 0.9650318 [47,] -0.8464474 0.9613811 [48,] -1.0181230 0.9460292 [49,] -1.0205531 0.9407098 [50,] -1.0620780 0.9287171 [51,] -1.1837348 0.9190885 [52,] -1.1518968 0.9162258 [53,] -1.1122345 0.9080141 [54,] -1.1415165 0.9050245 [55,] -1.2007187 0.9001866 [56,] -1.1981057 0.8974227 [57,] -1.2339980 0.8939056 [58,] -1.2667427 0.8848493 [59,] -1.3312465 0.8790390 [60,] -1.4441022 0.8686228 [61,] -1.4193817 0.8575996 [62,] -1.3518965 0.8508638 [63,] -1.3536049 0.8480181 [64,] -1.3767648 0.8440541 [65,] -1.3445512 0.8375978 [66,] -1.3574390 0.8316555 [67,] -1.3254940 0.8279445 [68,] -1.3226439 0.8227138 [69,] -1.3449440 0.8202209 [70,] -1.3583974 0.8133189 [71,] -1.4055752 0.8096223 [72,] -1.4328432 0.8010736 [73,] -1.5151824 0.7914936 [74,] -1.4976101 0.7901972 [75,] -1.4936749 0.7887336 [76,] -1.5749599 0.7744673 [77,] -1.6005449 0.7704502 [78,] -1.7031021 0.7596616 [79,] -1.7147900 0.7575389 [80,] -1.7965190 0.7467748 [81,] -1.7659140 0.7417916 [82,] -1.8063703 0.7361351 [83,] -1.8518997 0.7209940 [84,] -1.8351903 0.7180604 [85,] -1.7549512 0.7117144 [86,] -1.7543408 0.7107888 [87,] -1.7942732 0.7004319 [88,] -1.7371518 0.6928254 [89,] -1.5898995 0.6774218 [90,] -1.5405543 0.6739249 [91,] -1.4997253 0.6699615 [92,] -1.5092589 0.6573121 [93,] -1.5221002 0.6546647 [94,] -1.5287676 0.6513594 [95,] -1.5165307 0.6386536 [96,] -1.4755746 0.6358774 [97,] -1.4429592 0.6321925 [98,] -1.4895798 0.6194658 [99,] -1.3582413 0.6075454 [100,] -1.4497053 0.5981371 [101,] -1.3812459 0.5929849 [102,] -1.5730367 0.5785360 [103,] -1.6188665 0.5745166 [104,] -1.7580205 0.5650172 [105,] -1.7620347 0.5618199 [106,] -1.7320712 0.5584462 [107,] -1.6601568 0.5535646 [108,] -1.6787447 0.5507118 [109,] -1.6178896 0.5466870 [110,] -1.6261829 0.5455833 [111,] -1.6536389 0.5387075 [112,] -1.6159860 0.5341636 [113,] -1.6244580 0.5263503 [114,] -1.8264470 0.5072868 [115,] -1.9154134 0.4986236 [116,] -1.9258967 0.4953273 [117,] -1.9293060 0.4929403 [118,] -1.9095284 0.4884288 [119,] -1.9465304 0.4847506 [120,] -1.8186841 0.4716523 > (tri <- trimean(x)) [,1] [,2] [1,] -0.8410177 1.2219487 [2,] -0.8409709 1.2046609 [3,] -0.8531925 1.1889814 [4,] -0.8657170 1.1744561 [5,] -0.8735091 1.1609317 [6,] -0.8811295 1.1469288 [7,] -0.8928856 1.1330436 [8,] -0.8957241 1.1199297 [9,] -0.9028279 1.1070229 [10,] -0.9155786 1.0945601 [11,] -0.9295539 1.0829366 [12,] -0.9407361 1.0743001 [13,] -0.9407361 1.0656038 [14,] -0.9615942 1.0575880 [15,] -0.9697378 1.0503393 [16,] -0.9785042 1.0431059 [17,] -0.9904606 1.0360722 [18,] -1.0011384 1.0291355 [19,] -1.0150319 1.0226045 [20,] -1.0295732 1.0159621 [21,] -1.0457457 1.0094077 [22,] -1.0585133 1.0030708 [23,] -1.0712813 0.9968875 [24,] -1.0881143 0.9910059 [25,] -1.1030214 0.9852471 [26,] -1.1030214 0.9794597 [27,] -1.1378700 0.9737871 [28,] -1.1575772 0.9681682 [29,] -1.1777920 0.9623661 [30,] -1.1964350 0.9567663 [31,] -1.2149321 0.9510489 [32,] -1.2336712 0.9451494 [33,] -1.2529390 0.9393013 [34,] -1.2705219 0.9335267 [35,] -1.2894536 0.9277238 [36,] -1.3087360 0.9216986 [37,] -1.3280535 0.9154554 [38,] -1.3523399 0.9096817 [39,] -1.3745216 0.9040706 [40,] -1.3945207 0.8987718 [41,] -1.4147125 0.8935011 [42,] -1.4355514 0.8880687 [43,] -1.4561737 0.8829004 [44,] -1.4771550 0.8775790 [45,] -1.4973719 0.8721883 [46,] -1.5179220 0.8670512 [47,] -1.5388220 0.8617193 [48,] -1.5589102 0.8563040 [49,] -1.5589102 0.8513251 [50,] -1.5900408 0.8463413 [51,] -1.6047746 0.8416404 [52,] -1.6047746 0.8371310 [53,] -1.6290444 0.8325196 [54,] -1.6429745 0.8280259 [55,] -1.6563467 0.8234353 [56,] -1.6683721 0.8188215 [57,] -1.6806613 0.8140900 [58,] -1.6922229 0.8092678 [59,] -1.7031358 0.8045822 [60,] -1.7125906 0.7999010 [61,] -1.7193592 0.7954163 [62,] -1.7268607 0.7911519 [63,] -1.7268607 0.7869335 [64,] -1.7455877 0.7826030 [65,] -1.7546078 0.7782009 [66,] -1.7645687 0.7738231 [67,] -1.7743949 0.7694495 [68,] -1.7851627 0.7649825 [69,] -1.7961926 0.7604812 [70,] -1.8068942 0.7558287 [71,] -1.8174747 0.7512019 [72,] -1.8271437 0.7464661 [73,] -1.8363563 0.7418199 [74,] -1.8438274 0.7373122 [75,] -1.8518479 0.7325881 [76,] -1.8601134 0.7276420 [77,] -1.8666703 0.7230212 [78,] -1.8727695 0.7182910 [79,] -1.8766461 0.7137422 [80,] -1.8803340 0.7089995 [81,] -1.8822388 0.7044334 [82,] -1.8848766 0.6997933 [83,] -1.8866532 0.6951051 [84,] -1.8874383 0.6907874 [85,] -1.8886168 0.6863109 [86,] -1.8916281 0.6818178 [87,] -1.8947178 0.6770596 [88,] -1.8969767 0.6724552 [89,] -1.9005691 0.6678817 [90,] -1.9075505 0.6636951 [91,] -1.9157976 0.6593640 [92,] -1.9251499 0.6549000 [93,] -1.9345027 0.6507097 [94,] -1.9437841 0.6463306 [95,] -1.9531337 0.6417804 [96,] -1.9629819 0.6375049 [97,] -1.9739926 0.6330277 [98,] -1.9739926 0.6283792 [99,] -1.9972668 0.6240130 [100,] -2.0117901 0.6198796 [101,] -2.0245971 0.6158940 [102,] -2.0392967 0.6118236 [103,] -2.0499826 0.6081778 [104,] -2.0499826 0.6044201 [105,] -2.0668622 0.6008379 [106,] -2.0739238 0.5970947 [107,] -2.0818759 0.5931839 [108,] -2.0917292 0.5891693 [109,] -2.0917292 0.5849381 [110,] -2.1128308 0.5805283 [111,] -2.1243718 0.5757621 [112,] -2.1355976 0.5709570 [113,] -2.1480616 0.5659566 [114,] -2.1606988 0.5609545 [115,] -2.1606988 0.5566800 [116,] -2.1750157 0.5525126 [117,] -2.1811517 0.5481109 [118,] -2.1874009 0.5433920 [119,] -2.1943497 0.5384655 [120,] -2.2005972 0.5332596 > (midr <- midrange(x)) [1] 34.01174 > midm <- array(NA,dim=8) > for (j in 1:8) midm[j] <- midmean(x,j) > midm [1] -1.991473 -1.907550 -1.991473 -1.907550 -1.907550 -1.991473 -1.907550 [8] -1.900569 > postscript(file="/var/wessaorg/rcomp/tmp/16isx1322745341.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/2z9ht1322745341.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/30oyt1322745341.tab") > > try(system("convert tmp/16isx1322745341.ps tmp/16isx1322745341.png",intern=TRUE)) character(0) > try(system("convert tmp/2z9ht1322745341.ps tmp/2z9ht1322745341.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.189 0.132 2.327