sleck
07-31-2008, 11:42 AM
how do you find the quantile of a single number in a distribution in R?
input: number
output: percentage
THank you!
input: number
output: percentage
THank you!
|
View Full Version : finding quantiles sleck 07-31-2008, 11:42 AM how do you find the quantile of a single number in a distribution in R? input: number output: percentage THank you! mp83 07-31-2008, 11:51 AM It's the p*** function, where *** is the distribution, eg pt(q, df, ncp, lower.tail = TRUE, log.p = FALSE) for a t distribution. > pt(3, df = 9) [1] 0.9925218 For help type ?p*** sleck 07-31-2008, 01:45 PM the distribution I have is non normal and discontinous, I'm not sure what kind of distribution this is. can I still use this function if I don't know what kind of distribution this is? mp83 07-31-2008, 02:42 PM OK.if you have no idea about the distribution then a resampling or bootstrap strategy casn be used. There are functions to do that in R,but you shhould get to understand what this is about > http://cran.r-project.org/web/packages/boot/index.html Roughly speaking, you use your sample to generate a bunch of samples that represent your true sampling distribution so as you can get a quantile by simply sorting and enumerate. Of course you can have a quantile the way in my actuarial classes by simply typing help("quantile") on yor R console (pretty much I'm sure this will do!) HiH TheEcologist 07-31-2008, 02:44 PM the distribution I have is non normal and discontinous, I'm not sure what kind of distribution this is. can I still use this function if I don't know what kind of distribution this is? You mean you have data (a vector of values)? or a function? for a vector of values see: ?quantile() In R. TheEcologist 07-31-2008, 05:08 PM OK.if you have no idea about the distribution then a resampling or bootstrap strategy casn be used. There are functions to do that in R,but you shhould get to understand what this is about > http://cran.r-project.org/web/packages/boot/index.html Roughly speaking, you use your sample to generate a bunch of samples that represent your true sampling distribution so as you can get a quantile by simply sorting and enumerate. Of course you can have a quantile the way in my actuarial classes by simply typing help("quantile") on yor R console (pretty much I'm sure this will do!) HiH Ah, your post wasn't here when I decided to post mine! :rolleyes: sry mp83 |