Displaying 4 results from an estimated 4 matches for "weightedmedian".
2005 Sep 20
3
Strange Result using weightedMedian
Dear all,
I found a strange result using R's weightedMedian function.
Consider the following:
> x <- c (0.2, 0.3, 0.5)
> w <- c (1,1,2)
> weightedMedian(x,w)
> 0.3666
In cases like above, when the weights are integers, one could argue that
the weighted
median should be the same as the standard median with the elements
repeated accord...
2010 Dec 02
1
mediana ponderada
Hola alguien sabe una sentencia simple para calcular la mediana ponderada
por una variable?
Gracias
--
"*El peor analfabeto, es el analfabeto político.* Él no ve, no habla, no
participa de los acontecimientos políticos. Él no sabe que el costo de la
vida, el precio del pescado, de la harina, del alquiler, del calzado o del
remedio dependen de las decisiones políticas. *El analfabeto
2010 Mar 30
2
weighted.median function from package R.basic
Dear all,
I want to apply a weighted median on a huge dataset, and I remember a
function from the package R.basic that could do this using an internal
sorting algorithm qsort. This speeded things up quite a bit. Alas, I can't
find that package anywhere anymore. There is a weighted.median function in
the package limma too, but I didn't use that before.
Anybody who knows what happened to
2011 Apr 21
0
C source code question (Robustbase edition)
...n*n
knew<-as.integer(k+nl)
found<-F
while(found==F & (nr-nl>n)){
j<-1
for(i in 2:n){
if(left[i]<=right[i]){
weight[j]=as.integer(right[i]-left[i]+1)
jh<-as.integer(left[i]+weight[j]/2);
work[j]=y[i]-y[as.integer(n-jh+1)]
j<-j+1
}
}
trial<-weightedMedian(x=work[1:(j-1)],w=weight[1:(j-1)])
j<-0
for(i in n:1){
while((j<(n-1)) & ((y[i]-y[n-j])<trial)) j<-j+1
p[i]<-j
}
j<-n+1
for(i in 1:n){
while((y[i]-y[n-j+2])>trial) j<-j-1
q[i]<-j
}
sump<-sumq<-0
for(i in 1:n){...