Re: Help with Percentile formula !!
- To: mathgroup at smc.vnet.net
- Subject: [mg19398] Re: [mg19371] Help with Percentile formula !!
- From: BobHanlon at aol.com
- Date: Mon, 23 Aug 1999 13:57:13 -0400
- Sender: owner-wri-mathgroup at wolfram.com
Mike, Needs["Statistics`DescriptiveStatistics`"] data = Table[500*Random[], {1000}]; ?Quantile Quantile[list, q] gives the q-th quantile of the entries in list (the fraction of entries in list that are less than this value is q). Finding the values that correspond to 10%, 20%, ..., 100%, of the data percentiles = Table[Quantile[data, pct/100], {pct, 10, 100, 10}] {49.23368229765424, 110.28038943739725, 160.5545908527711, 206.07001160045024, 252.1836741925545, 303.5777054159099, 349.25003576787134, 404.0345392807842, 449.5247014457069, 499.9606579813818} Checking by counting the values Table[Length[Select[data, # <= percentiles[[pct/10]] &]], {pct, 10, 100, 10}] {100, 200, 300, 400, 500, 600, 700, 800, 900, 1000} Bob Hanlon In a message dated 8/21/99 5:14:57 AM, mike_brydon at msn.com writes: >Does anyone know the formula to work out percentiles given a list of values.