473,503 Members | 1,797 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

C# percentile rank algorithm

Joe
Has anyone written a percentile rank algorithm that they can share or
know of a good resource that defines the algorithm. I'm starting a
project that involves percentile ranks, logistic and linear regression.
If not c# any language or pseudo code would be very useful. Thank you.

Joe

--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com
Nov 30 '05 #1
1 14269
Joe wrote:
Has anyone written a percentile rank algorithm that they can share or
know of a good resource that defines the algorithm. I'm starting a
project that involves percentile ranks, logistic and linear regression.
If not c# any language or pseudo code would be very useful. Thank you.

Joe

--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com


Forgive me if I'm wrong but isn't percentile rank just counting how many
of the values are below or equal the specific value you're looking at in
terms of percentage of the entire list of values ?

Ie. if you have a value of 50, and there are 75 values in the list, and
30 of those are 50 or below, wouldn't this mean that the percentile rank
of 50 in this list is (30/75)*100 = 40%?

I'd assume sorting the list, then running through it and assigning
percentile ranks would be the best way. You'd have to handle duplicate
values though:

1, 1, 2, 2, 3, 3, 4

would have percentile ranks of:

25%, 25%, 50%, 50%, 75%, 75%, 100%

(if I'm not wrong about what a percentile rank is)

pseudo-code for the above:

- sort list
- loop through all elements from start to finish (lowest to highest)
- find all duplicates of the value you're looking at
- calculate percentile rank as number of values below the value
(index of the loop), plus the number of duplicates, divided by
the number of elements in the list
- skip past duplicates

--
Lasse Vågsæther Karlsen
http://usinglvkblog.blogspot.com/
mailto:la***@vkarlsen.no
PGP KeyID: 0x2A42A1C2
Nov 30 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
2580
by: adrianTNT | last post by:
Hello; Anyone knows how can I create a scrip that returns the google page rank of a given web page? I have seen this on many web pages but I want to host my own script and I dont know how it...
2
3272
by: jd142 | last post by:
Normally when people ask about getting the Nth percentile from a group, the response is to write a couple of VBA modules. But it seems to me there's a simpler way that just uses 2 queries. You...
2
1940
by: dam_fool_2003 | last post by:
Just now I asked a question about signed char and unsigned char. I had the replay very fast by jens.torring and Tim prince. I post via google so now goes my thanking replay. (I must be more precise...
3
13449
by: Dave Veeneman | last post by:
I'm looking from an algorithm that will do a statistics calculation for me-- it's the first time 'Numerical Recipies in C' has failed me! A normal distribution table tells me the probability (by...
13
5001
by: Steve Edwards | last post by:
Hi, Given a map: typedef map<long, string, greater<long> > mapOfFreq; Is there a quicker way to find the rank (i.e. index) of the elememt that has the long value of x? At the moment I'm...
2
2936
by: orenlevy1 | last post by:
Hi Everyone. I have a problem that I could not figure out what to do with it. I have a couple of tables and views. All have the same unique ID. When a user try to do a search on our web site...
28
19627
by: riaane | last post by:
Hey clever people, Excel has the =PERCENTILE function. This calulates a percentile value from an array of values. Is there any equivalent in Access?
5
4497
by: artemetis | last post by:
Hello! It's me again. tblEmp -->empUid - self explanatory -->empPerf - ranking from 0 - 100 I'm interested in creating a query that displays the top x% (eg, 20%) of employee performance,...
19
11127
by: SachinPatel | last post by:
ADezii, i have been reading your solution to this percentile problem and believe you can help me. I have a similar problem with creating a percentile in access 2007. My table is called...
0
7199
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7076
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
6984
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7453
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5576
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4670
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3151
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1507
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
377
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.