Try the linear quantile regression function rq() in the quantreg package.
For 1 sample estimates, your model would have just an intercept term.
There is a weight argument.
quantiles.out <- rq(y ~ 1, data=mydata, tau=1:9/10, weight=myweights)
would yield the 0.10, 0.20, ..., 0.80, 0.90 weighted quantile estimates.
Brian
Brian S. Cade, PhD
U. S. Geological Survey
Fort Collins Science Center
2150 Centre Ave., Bldg. C
Fort Collins, CO 80526-8818
email: brian_cade@usgs.gov
tel: 970 226-9326
sj <ssj1364@gmail.com>
Sent by: r-help-bounces@r-project.org
10/07/2008 12:38 PM
To
r-help <r-help@stat.math.ethz.ch>
cc
Subject
[R] weighted quantiles
I have a set of values and their corresponding weights. I can use the
function weighted.mean to calculate the weighted mean, I would like to be
able to similarly calculate the weighted median and quantiles? Is there a
function in R that can do this?
thanks,
Spencer
[[alternative HTML version deleted]]
______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
[[alternative HTML version deleted]]