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(-45.03512967 + ,-19.98355167 + ,-0.074551362 + ,39.39682555 + ,72.98801962 + ,86.25153542 + ,81.85954852 + ,74.94478284 + ,69.70723837 + ,64.50633009 + ,53.75492821 + ,49.41639653 + ,45.07885206 + ,41.80072257 + ,39.84239199 + ,28.4088146 + ,23.53761382 + ,15.42878963 + ,10.48234204 + ,-3.945293842 + ,-11.12046172 + ,-13.58078497 + ,-12.97377734 + ,-13.19251011 + ,-16.30530139 + ,-17.50622793 + ,-6.990463307 + ,-9.322066281 + ,-13.79719762 + ,-16.56337105 + ,1.808042385 + ,24.51609202 + ,28.05684729 + ,29.98667024 + ,31.7491623 + ,32.17105108 + ,19.84045358 + ,27.15438991 + ,21.19110504 + ,10.45659524 + ,14.45270708 + ,14.26168913 + ,22.40533295 + ,20.81234059 + ,11.35697162 + ,7.396648359 + ,-4.4260515 + ,-19.62293789 + ,-22.24364508 + ,-36.12970874 + ,-40.23557131 + ,-41.32955088 + ,-42.61066025 + ,-39.85315902 + ,-41.61446948 + ,-41.46290975 + ,-40.66778511 + ,-47.54584154 + ,-55.46550672 + ,-45.12780439 + ,-44.89406915 + ,-31.81775621 + ,-37.18690953 + ,-36.92246132 + ,-34.59565478 + ,-34.43716634 + ,-35.79253531 + ,-32.55285857 + ,-32.35179244 + ,-46.01198784 + ,-43.93766758 + ,-40.57621752 + ,-36.67317698 + ,-32.85132473 + ,-30.05323848 + ,-37.48083784 + ,-37.37085032 + ,-35.70444597 + ,-34.59447672 + ,-30.42114367 + ,-37.66060776 + ,-37.78723817 + ,-34.83962726 + ,-34.441541 + ,-29.56917689 + ,-21.52752574 + ,-22.10764791 + ,-21.1996348 + ,-19.40845899 + ,-14.83412046 + ,-9.591482108 + ,-13.24284746 + ,-13.10710127 + ,-9.684261822 + ,-9.502994594 + ,-10.09991752 + ,-7.539454667 + ,-2.414640805 + ,-4.853135952 + ,0.19937446 + ,4.499416857 + ,1.690629202 + ,5.642170673 + ,3.454114333 + ,-1.318037127 + ,3.151328839 + ,-4.267330871 + ,-12.17812947 + ,-2.542291957 + ,63.11243032 + ,55.74843222 + ,46.14756047 + ,40.21796844 + ,38.82596328 + ,34.38741333 + ,23.65480489 + ,7.292488952 + ,7.663847594 + ,9.140197061 + ,11.75906942 + ,11.50170778 + ,6.124547232 + ,3.254315386 + ,-3.566410062 + ,-10.78713551 + ,-9.808848164 + ,-10.49293742 + ,-18.15920218 + ,-12.45120734 + ,-9.002572686 + ,-24.25492524 + ,-25.6409889 + ,-15.91515131 + ,-19.37541977 + ,-22.82585271 + ,-16.81683414 + ,-17.52368391 + ,-16.04936365 + ,-7.213653999 + ,-8.953191147 + ,-5.417481494 + ,-6.643106439 + ,-11.23699468 + ,-5.395343534 + ,-1.775447434 + ,12.57607577 + ,12.8018951 + ,8.101114686 + ,15.93187005 + ,14.64088862 + ,21.28948674 + ,18.56281979 + ,14.03021135 + ,8.577822264 + ,-6.029996451 + ,0.287888707 + ,1.431514269 + ,9.469198332 + ,-1.803940333 + ,-6.690936406 + ,1.639818954 + ,8.420080711 + ,18.77460206 + ,18.74793512 + ,6.566953605 + ,8.461091035 + ,2.465118786 + ,4.719640139 + ,7.379115785 + ,11.99403933 + ,1.812966486 + ,-2.220537837 + ,-4.686802595 + ,-3.953067353 + ,-8.113390613 + ,-14.16084367 + ,-14.68751062 + ,-16.76560358 + ,-19.06651185 + ,-21.62584791 + ,-17.4742699 + ,-8.549492574 + ,-10.89893831 + ,-11.70578808 + ,-5.831449559 + ,-8.238299334 + ,1.461724798 + ,3.715222415 + ,-2.979744364 + ,-6.574711142 + ,-15.80730132 + ,-17.6022681 + ,-18.01010508 + ,-7.255565462 + ,-5.519837544 + ,-9.078113331 + ,-6.14732144 + ,-3.078924414 + ,-0.786761395 + ,-17.60536631 + ,-17.41914479 + ,-24.33292327 + ,-22.15461765 + ,-16.11691533 + ,-10.38118741 + ,-23.51562414 + ,-62.02903731 + ,-59.87649037 + ,-56.54472954 + ,-52.19907477 + ,24.36040088 + ,101.2410462 + ,72.18000973 + ,66.32173394 + ,69.88122785 + ,67.40797959 + ,72.56546256 + ,57.7100936 + ,48.87450527 + ,47.7933959 + ,40.2450287 + ,45.65496141 + ,45.99363268 + ,55.13029301 + ,52.24719096 + ,45.11257158 + ,39.63840918 + ,33.45929248 + ,27.6810534 + ,23.94158931 + ,20.63969383 + ,23.72191173 + ,13.86261221 + ,15.29634745 + ,4.268766361 + ,-24.58333048 + ,-34.06241064 + ,-37.87019283 + ,-44.19386162 + ,-27.34440416 + ,-19.14439829 + ,-53.41623924 + ,-116.529214 + ,-59.75999419 + ,-84.51589373 + ,-52.87718593 + ,40.79150421 + ,57.32810975 + ,61.08455071 + ,49.21523301 + ,49.51622608 + ,21.30358093 + ,7.969016343 + ,-10.58521929 + ,23.59677942 + ,12.88799177 + ,26.25421346 + ,19.85922842 + ,16.34844809 + ,11.81386523 + ,19.10489492 + ,10.34159178 + ,-2.121583504 + ,-7.901669139 + ,-6.855063695 + ,-2.229280893 + ,0.221328169 + ,1.857037822 + ,7.67492298 + ,0.01363078 + ,10.99579389 + ,16.44435548 + ,20.69684762 + ,29.50486073 + ,-1.773104375 + ,-23.92823589 + ,12.62416493 + ,35.7508984 + ,29.15200107 + ,31.94805811 + ,28.66298165 + ,28.65406614 + ,30.60761855 + ,37.76506499 + ,28.69682582 + ,24.20386999 + ,14.19111524 + ,13.8020717 + ,20.96745231 + ,32.04564833 + ,30.30218063 + ,16.43401452 + ,5.830217688 + ,31.63506825 + ,26.32030257 + ,19.90555515 + ,15.96408012 + ,25.83931453 + ,17.36619413 + ,11.46726026 + ,9.611946089 + ,13.22884404 + ,-5.345227034 + ,0.431158964 + ,14.95688697 + ,12.38069536 + ,29.1311583 + ,27.64408916 + ,16.48091388 + ,11.43249188 + ,5.963338569 + ,14.82765892 + ,22.84069937 + ,17.78829202 + ,24.59723754 + ,27.05777345 + ,16.9687847 + ,22.67277592 + ,16.33729718 + ,19.40070339 + ,18.16813147 + ,10.89592522 + ,4.58613209 + ,11.23476674 + ,0.784479926 + ,-3.490669682 + ,-0.553899762 + ,0.71645341 + ,-10.10421724 + ,-28.54858083 + ,-0.038739435 + ,-2.030708066 + ,-15.3710863 + ,-16.75616275 + ,-38.54899073 + ,-57.01308016 + ,-31.31000308 + ,-68.09283115 + ,-87.58357513 + ,-50.61728037 + ,-36.44793267 + ,-15.01033993 + ,-4.904483893 + ,9.859964311 + ,15.16591168 + ,-3.361541556 + ,-25.98316288 + ,-32.06326678 + ,-61.312402 + ,-49.55901398 + ,-25.62635727 + ,-28.87574821 + ,-16.79651019 + ,-22.89555365 + ,-25.77662649 + ,-33.25662079 + ,-28.72590197 + ,-29.70306251 + ,-50.76413553 + ,-70.04806039) > 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] 1.166666e-10 > sqrtn <- sqrt(length(x)) > (armse <- sd(x) / sqrtn) [1] 1.632401 > (armose <- arm / armse) [1] 7.146938e-11 > (geo <- geomean(x)) [1] NaN Warning message: In log(x) : NaNs produced > (har <- harmean(x)) [1] 7.712594 > (qua <- quamean(x)) [1] 30.92958 > (win <- winmean(x)) [,1] [,2] [1,] 0.038767023 1.6116038 [2,] 0.031409770 1.6055131 [3,] 0.094352000 1.5813202 [4,] 0.094334956 1.5758346 [5,] 0.172685467 1.5653406 [6,] 0.178205175 1.5631993 [7,] 0.161427142 1.5545079 [8,] 0.160149513 1.5537471 [9,] 0.171340895 1.5394245 [10,] 0.154177144 1.5344343 [11,] 0.131682723 1.5244680 [12,] 0.153528314 1.5122007 [13,] 0.099765142 1.5018960 [14,] -0.005092756 1.4847816 [15,] 0.038780385 1.4772692 [16,] -0.024900609 1.4691391 [17,] -0.004116826 1.4613047 [18,] 0.027773556 1.4447577 [19,] 0.029151925 1.4292416 [20,] -0.073447044 1.4096954 [21,] -0.073864409 1.4086442 [22,] -0.077537370 1.4066769 [23,] -0.054570606 1.4006067 [24,] -0.109564961 1.3921472 [25,] -0.131705801 1.3732934 [26,] -0.070875697 1.3661025 [27,] -0.084909063 1.3627601 [28,] -0.116722582 1.3579541 [29,] -0.066129967 1.3532208 [30,] -0.331676792 1.3278085 [31,] -0.389248283 1.3177113 [32,] -0.403831680 1.3106421 [33,] -0.286763444 1.3005167 [34,] -0.258125863 1.2922191 [35,] -0.269892488 1.2898537 [36,] -0.281387810 1.2867498 [37,] -0.321583413 1.2802368 [38,] -0.421957328 1.2698372 [39,] -0.620231789 1.2502357 [40,] -0.742346996 1.2357029 [41,] -0.819658932 1.2250831 [42,] -0.943675259 1.2113591 [43,] -0.920643840 1.2071234 [44,] -0.891361448 1.2028767 [45,] -0.905212257 1.2000996 [46,] -0.809286328 1.1901297 [47,] -0.911573632 1.1774978 [48,] -0.952141613 1.1744576 [49,] -0.974269832 1.1696226 [50,] -1.040580228 1.1646626 [51,] -1.037478289 1.1567884 [52,] -0.924097044 1.1473728 [53,] -0.928371850 1.1380486 [54,] -0.888678552 1.1341905 [55,] -0.859322207 1.1317066 [56,] -0.852590677 1.1254665 [57,] -0.869446328 1.1184417 [58,] -0.848186228 1.1078035 [59,] -0.708570075 1.0962898 [60,] -0.728869085 1.0858098 [61,] -0.685904835 1.0801868 [62,] -0.789855630 1.0694320 [63,] -0.680071205 1.0595683 [64,] -0.727191683 1.0523891 [65,] -0.919439267 1.0344206 [66,] -0.713550223 1.0171313 [67,] -0.489183947 0.9968601 [68,] -0.479738463 0.9920339 [69,] -0.504011722 0.9867115 [70,] -0.543881768 0.9835678 [71,] -0.351408667 0.9681781 [72,] -0.312932319 0.9638924 [73,] -0.309113521 0.9619664 [74,] -0.385215347 0.9474769 [75,] -0.334238618 0.9391588 [76,] -0.259795030 0.9263530 [77,] -0.480539289 0.9094421 [78,] -0.357448044 0.9006517 [79,] -0.359500786 0.8978856 [80,] -0.398763673 0.8938636 [81,] -0.325258810 0.8842358 [82,] -0.329169936 0.8809835 [83,] -0.266749982 0.8750549 [84,] -0.154296277 0.8449588 [85,] -0.080089613 0.8386887 [86,] -0.033338087 0.8350730 [87,] -0.131626572 0.8275402 [88,] -0.147463392 0.8191431 [89,] -0.209863868 0.8125688 [90,] 0.010296815 0.7976047 [91,] 0.001192207 0.7921574 [92,] 0.003760655 0.7790584 [93,] -0.093564165 0.7726585 [94,] -0.183259409 0.7642851 [95,] -0.283524903 0.7573123 [96,] -0.405101647 0.7485562 [97,] -0.400098950 0.7469943 [98,] -0.238951646 0.7364736 [99,] -0.256893328 0.7346404 [100,] -0.251405633 0.7339071 [101,] -0.353465075 0.7271720 [102,] -0.307966947 0.7231752 [103,] -0.378067248 0.7095876 [104,] -0.361905682 0.7038169 [105,] -0.380246875 0.7002334 [106,] -0.402274962 0.6939712 [107,] -0.408628996 0.6896104 [108,] -0.333795580 0.6780506 [109,] -0.281546785 0.6678182 [110,] -0.286068543 0.6609306 [111,] -0.262624125 0.6568281 [112,] -0.148831173 0.6437792 [113,] -0.087294226 0.6336525 [114,] -0.037934715 0.6283543 [115,] -0.113096846 0.6106914 [116,] -0.206707209 0.6030557 [117,] -0.206930754 0.5997000 [118,] -0.221486133 0.5935671 [119,] -0.064643855 0.5823208 [120,] -0.038744702 0.5730032 > (tri <- trimean(x)) [,1] [,2] [1,] 0.042704379 1.5837235 [2,] 0.046685976 1.5546441 [3,] 0.054453539 1.5275984 [4,] 0.040851791 1.5083160 [5,] 0.027098977 1.4898191 [6,] -0.003022366 1.4729958 [7,] -0.034449107 1.4559423 [8,] -0.063732932 1.4397026 [9,] -0.093191149 1.4229516 [10,] -0.124312565 1.4075064 [11,] -0.153974191 1.3920896 [12,] -0.181797917 1.3772294 [13,] -0.181797917 1.3631129 [14,] -0.237914626 1.3494935 [15,] -0.256056590 1.3369776 [16,] -0.277630027 1.3246530 [17,] -0.295073008 1.3125510 [18,] -0.314089752 1.3006199 [19,] -0.335323498 1.2895178 [20,] -0.356904280 1.2791458 [21,] -0.372949029 1.2697769 [22,] -0.389174235 1.2601172 [23,] -0.405414720 1.2502121 [24,] -0.423015595 1.2403129 [25,] -0.438182561 1.2305625 [26,] -0.438182561 1.2215910 [27,] -0.469779926 1.2126906 [28,] -0.486660227 1.2036293 [29,] -0.502409701 1.1944796 [30,] -0.520462656 1.1852225 [31,] -0.528064771 1.1770039 [32,] -0.533510928 1.1689933 [33,] -0.538473144 1.1610259 [34,] -0.547876993 1.1532518 [35,] -0.558456142 1.1455757 [36,] -0.568761987 1.1376947 [37,] -0.578810035 1.1296336 [38,] -0.587622519 1.1215513 [39,] -0.593187979 1.1136328 [40,] -0.592296425 1.1063182 [41,] -0.587438673 1.0993709 [42,] -0.580050966 1.0926111 [43,] -0.568675857 1.0861784 [44,] -0.557842369 1.0796494 [45,] -0.547735731 1.0730172 [46,] -0.537064790 1.0662065 [47,] -0.529055656 1.0595335 [48,] -0.517957456 1.0531093 [49,] -0.517957456 1.0465160 [50,] -0.492283083 1.0398234 [51,] -0.476981767 1.0330267 [52,] -0.476981767 1.0262497 [53,] -0.448918992 1.0195626 [54,] -0.435995734 1.0129546 [55,] -0.423924192 1.0061908 [56,] -0.412432749 0.9992014 [57,] -0.400930364 0.9921354 [58,] -0.388803117 0.9850192 [59,] -0.377020706 0.9780061 [60,] -0.368591485 0.9711395 [61,] -0.359508857 0.9643707 [62,] -0.351346690 0.9574939 [63,] -0.351346690 0.9507163 [64,] -0.332100904 0.9440101 [65,] -0.322438358 0.9372531 [66,] -0.307936311 0.9308939 [67,] -0.298146756 0.9249373 [68,] -0.293564307 0.9195156 [69,] -0.289124542 0.9139905 [70,] -0.284028403 0.9083751 [71,] -0.277898180 0.9025696 [72,] -0.276172582 0.8970888 [73,] -0.275313709 0.8914691 [74,] -0.274527464 0.8855997 [75,] -0.271963266 0.8800064 [76,] -0.270526142 0.8744348 [77,] -0.270772898 0.8690769 [78,] -0.265965417 0.8641119 [79,] -0.263875182 0.8592122 [80,] -0.261696371 0.8541169 [81,] -0.258581205 0.8488677 [82,] -0.257069241 0.8437019 [83,] -0.255437594 0.8383399 [84,] -0.255182043 0.8328886 [85,] -0.257457661 0.8284120 [86,] -0.261453437 0.8238971 [87,] -0.266587316 0.8192224 [88,] -0.269622415 0.8145569 [89,] -0.272368247 0.8099361 [90,] -0.273772840 0.8052788 [91,] -0.280156428 0.8009570 [92,] -0.286480448 0.7965570 [93,] -0.293007610 0.7924250 [94,] -0.297496209 0.7882678 [95,] -0.300069754 0.7841733 [96,] -0.300442946 0.7800763 [97,] -0.298078668 0.7760577 [98,] -0.298078668 0.7717763 [99,] -0.297058333 0.7676503 [100,] -0.297971174 0.7632600 [101,] -0.299032162 0.7585297 [102,] -0.297788454 0.7537399 [103,] -0.297555181 0.7487438 [104,] -0.297555181 0.7440275 [105,] -0.294176122 0.7391958 [106,] -0.292182205 0.7341208 [107,] -0.289621246 0.7289292 [108,] -0.286840691 0.7235054 [109,] -0.286840691 0.7182398 [110,] -0.285837350 0.7130656 [111,] -0.285831867 0.7077946 [112,] -0.286385311 0.7022532 [113,] -0.289684851 0.6969539 [114,] -0.294569580 0.6917359 [115,] -0.294569580 0.6863067 [116,] -0.305394280 0.6814292 [117,] -0.307824996 0.6765111 [118,] -0.310328576 0.6712685 [119,] -0.312550254 0.6658543 [120,] -0.318799995 0.6605871 > (midr <- midrange(x)) [1] -7.644084 > midm <- array(NA,dim=8) > for (j in 1:8) midm[j] <- midmean(x,j) > midm [1] -0.3776001 -0.2737728 -0.3776001 -0.2737728 -0.2737728 -0.3776001 -0.2737728 [8] -0.2723682 > postscript(file="/var/wessaorg/rcomp/tmp/1nb9r1324134223.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/2s3af1324134223.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/3vztn1324134223.tab") > > try(system("convert tmp/1nb9r1324134223.ps tmp/1nb9r1324134223.png",intern=TRUE)) character(0) > try(system("convert tmp/2s3af1324134223.ps tmp/2s3af1324134223.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.088 0.206 2.619