Jeff Newmiller
2021-Mar-05 18:09 UTC
[R] quantile from quantile table calculation without original data
Your example could probably be resolved with approx. If you want a more robust solution, it looks like the fBasics package can do spline interpolation. You may want to spline on the log of your size variable and use exp on the output if you want to avoid negative results. On March 5, 2021 1:14:22 AM PST, PIKAL Petr <petr.pikal at precheza.cz> wrote:>Dear all > >I have table of quantiles, probably from lognormal distribution > > dput(temp) >temp <- structure(list(size = c(1.6, 0.9466, 0.8062, 0.6477, 0.5069, >0.3781, 0.3047, 0.2681, 0.1907), percent = c(0.01, 0.05, 0.1, >0.25, 0.5, 0.75, 0.9, 0.95, 0.99)), .Names = c("size", "percent" >), row.names = c(NA, -9L), class = "data.frame") > >and I need to calculate quantile for size 0.1 > >plot(temp$size, temp$percent, pch=19, xlim=c(0,2)) >ss <- approxfun(temp$size, temp$percent) >points((0:100)/50, ss((0:100)/50)) >abline(v=.1) > >If I had original data it would be quite easy with ecdf/quantile >function but without it I am lost what function I could use for such >task. > >Please, give me some hint where to look. > > >Best regards > >Petr >Osobn? ?daje: Informace o zpracov?n? a ochran? osobn?ch ?daj? >obchodn?ch partner? PRECHEZA a.s. jsou zve?ejn?ny na: >https://www.precheza.cz/zasady-ochrany-osobnich-udaju/ | Information >about processing and protection of business partner's personal data are >available on website: >https://www.precheza.cz/en/personal-data-protection-principles/ >D?v?rnost: Tento e-mail a jak?koliv k n?mu p?ipojen? dokumenty jsou >d?v?rn? a podl?haj? tomuto pr?vn? z?vazn?mu prohl?en? o vylou?en? >odpov?dnosti: https://www.precheza.cz/01-dovetek/ | This email and any >documents attached to it may be confidential and are subject to the >legally binding disclaimer: https://www.precheza.cz/en/01-disclaimer/ > > > [[alternative HTML version deleted]]-- Sent from my phone. Please excuse my brevity.
Martin Maechler
2021-Mar-08 08:41 UTC
[R] quantile from quantile table calculation without original data
>>>>> Jeff Newmiller >>>>> on Fri, 05 Mar 2021 10:09:41 -0800 writes:> Your example could probably be resolved with approx. If > you want a more robust solution, it looks like the fBasics > package can do spline interpolation. base R's spline package does spline interpolation !! Martin