Displaying 4 results from an estimated 4 matches for "204.4444".
Did you mean:
20.444
2017 Nov 24
2
number to volume weighted distribution
Dear all
Strictly speaking it is not R question but as you are the most capable persons I know I give it a try.
I am strugling with recalculation of number weighted to volume weighted distribution.
Suppose I have objects (cubes) with size
x<- c(rep(10,20), rep(100, 10), rep(300,5))
I can get
plot(ecdf(x))
or the number weighted average
mean(x)
[1] 77.14286
or volume weighted average
2017 Nov 24
0
number to volume weighted distribution
On 24/11/2017 6:27 AM, PIKAL Petr wrote:
> Dear all
>
> Strictly speaking it is not R question but as you are the most capable persons I know I give it a try.
>
> I am strugling with recalculation of number weighted to volume weighted distribution.
>
> Suppose I have objects (cubes) with size
>
> x<- c(rep(10,20), rep(100, 10), rep(300,5))
> I can get
>
2017 Nov 24
2
number to volume weighted distribution
Hi Duncan
I tried Ecdf and/or wtd.quantile from Hmisc and it is working (probably).
Ecdf(x, q=.5)
Ecdf(x, weights=xw,col=2, add=T, q=.5)
wtd.quantile(x)
0% 25% 50% 75% 100%
10 10 10 100 300
wtd.quantile(x, weights=xw, type="i/n")
0% 25% 50% 75% 100%
10.0000 138.8667 192.5778 246.2889 300.0000
But could you please be more specific in this?
>
2017 Nov 24
0
number to volume weighted distribution
Hi Petr,
I think that Duncan suggests something like this:
x<- c(rep(10,20), rep(300,5), rep(100, 10))
tx <- table(x)
prop.x <- tx / sum(tx)
vx <- as.integer(names(tx))
prop.wx <- tx * vx / sum(tx * vx)
plot(ecdf(x))
plot(vx, cumsum(prop.x), ylim = 0:1)
plot(vx, cumsum(prop.wx), ylim = 0:1)
Best regards,
Thierry
ir. Thierry Onkelinx
Statisticus / Statistician
Vlaamse