ite a vectorization of the above that will work given a vector of 'p'
cumulative probabilities:
qtl <-
function(p, x, w)
{
if(length(p)==1) ans <- qtl.one(p, x, w)
if(length(p) >1)
ans <- sapply(p, FUN=qtl.one, x=x,w=w)
ans
}
___
On 26/01/2024 10:38 a.m., Michael Meyer via R-help wrote:
Greetings,
I am having a problem with DescTools::Quantile
(a function computing quantiles from weighted samples):
# these sum to one
probWeights = c(
0.0043, 0.0062, 0.0087, 0.0119, 0.0157, 0.0204, 0.0257, 0.0315, 0.0378,
0.0
2 matches
Mail list logo