+ Reply to Thread
Results 1 to 6 of 6

Thread: finding quantiles

  1. #1
    Points: 3,039, Level: 33
    Level completed: 93%, Points required for next Level: 11

    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    finding quantiles




    how do you find the quantile of a single number in a distribution in R?
    input: number
    output: percentage

    THank you!

  2. #2
    TS Contributor
    Points: 5,172, Level: 46
    Level completed: 11%, Points required for next Level: 178

    Location
    Athens , Greece
    Posts
    330
    Thanks
    0
    Thanked 6 Times in 2 Posts
    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***

  3. #3
    Points: 3,039, Level: 33
    Level completed: 93%, Points required for next Level: 11

    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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?

  4. #4
    TS Contributor
    Points: 5,172, Level: 46
    Level completed: 11%, Points required for next Level: 178

    Location
    Athens , Greece
    Posts
    330
    Thanks
    0
    Thanked 6 Times in 2 Posts
    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

  5. #5
    R purist
    Points: 35,103, Level: 100
    Level completed: 0%, Points required for next Level: 0
    TheEcologist's Avatar
    Location
    United States
    Posts
    1,921
    Thanks
    303
    Thanked 607 Times in 341 Posts
    Quote Originally Posted by sleck View Post
    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.
    The true ideals of great philosophies always seem to get lost somewhere along the road..

  6. #6
    R purist
    Points: 35,103, Level: 100
    Level completed: 0%, Points required for next Level: 0
    TheEcologist's Avatar
    Location
    United States
    Posts
    1,921
    Thanks
    303
    Thanked 607 Times in 341 Posts

    Thumbs down Oeps


    Quote Originally Posted by mp83 View Post
    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!

    sry mp83
    The true ideals of great philosophies always seem to get lost somewhere along the road..

+ Reply to Thread

           




Similar Threads

  1. Quantiles for the Wishart distribution
    By jessica01 in forum Probability
    Replies: 1
    Last Post: 01-25-2011, 02:26 PM
  2. Weighted quantiles
    By Erika.A. in forum Statistics
    Replies: 0
    Last Post: 02-16-2010, 02:21 PM
  3. finding p-value
    By hanelliot in forum Statistics
    Replies: 5
    Last Post: 04-25-2009, 04:23 PM
  4. Finding MME and MLE
    By statsrocks in forum Statistics
    Replies: 0
    Last Post: 11-09-2008, 04:47 PM
  5. Replies: 0
    Last Post: 06-23-2008, 09:54 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts






Advertise on Talk Stats