Re: [R] Percentiles for unequal probability sample

2013-11-21 Thread Thomas Lumley
On Thu, Nov 21, 2013 at 8:35 AM, Trevor Walker trevordaviswal...@gmail.comwrote: I often work with tree data that is sampled with probability proportional to size, which presents a special challenge when describing the frequency distribution. The survey package does lots of calculations

[R] Percentiles for unequal probability sample

2013-11-20 Thread Trevor Walker
I often work with tree data that is sampled with probability proportional to size, which presents a special challenge when describing the frequency distribution. For example, R functions like quantile() and fitdistr() expect each observation to have equal sample probability. As a workaround, I

Re: [R] Percentiles for unequal probability sample

2013-11-20 Thread Adams, Jean
Rather than exploding, I suggest you order your data according to tree diameter, then calculate the cumulative sum of the tree densities, and use linear interpolation to estimate the percentiles. For example ... library(plotrix) attach(trees.df) ord - order(Diameter) CumDensOrdScaled -

Re: [R] Percentiles for unequal probability sample

2013-11-20 Thread David Winsemius
On Nov 20, 2013, at 11:35 AM, Trevor Walker wrote: I often work with tree data that is sampled with probability proportional to size, which presents a special challenge when describing the frequency distribution. For example, R functions like quantile() and fitdistr() expect each