############## Data with outlier(wo) wo =c(2.2,2.2,2.4,2.4,2.5,2.7,2.8,2.9,3.03,3.03,3.1,3.37,3.4,3.4,3.4,3.5,3.6,3.7,3.7,3.7,3.7,3.77,5.28,28.95) ############## Data with out outlier(woo) woo=c(2.2,2.2,2.4,2.4,2.5,2.7,2.8,2.9,3.03,3.03,3.1,3.37,3.4,3.4,3.4,3.5,3.6,3.7,3.7,3.7,3.7,3.77,5.28) ############################ Hodges and Lehmann Estimator hl=function(x) { c=1; yy=c() for(i in 1:length(x)) { for(j in 1:length(x)) { yy[c]=(x[i]+x[j])/2 # Walsh averages c=c+1 } } hlehm=median(yy) ####Hodges and Lehmann Estimator return(hlehm) } ######################################## Trimean trimn=function(x) { trm=(quantile(x,0.25,type=6)+2*quantile(x,0.50,type=6)+quantile(x,0.75,type=6))/4 return(trm) } ############### Different LOcation Measures mean(wo) mean(woo) median(wo) median(woo) trimn(wo) trimn(woo) hl(wo) hl(woo)