Jump to content

Median price


dreamwest

Recommended Posts

I have a few prices and need to find the median of them, the problem is there is sometimes one really high price that distorts the median.

 

Is there a way to normalize the figures?

 

Example numbers

 

76
87
95
78
104
1098

 

Normally i would do it this way but it gives a distorted view of the median number

 

$lowest = 76;
$highest = 1098;

$mid = (($lowest - highest) / 2) + $lowest; // echos 511

Link to comment
https://forums.phpfreaks.com/topic/264292-median-price/
Share on other sites

Your trying to eliminate anomalies? Moreover, your not even working the median number out doing this. Your working out the average of two numbers otherwise referred to as the mean number; you then add the lowest figure to it completely throwing it off and well... I don't even think there is a word to describe what your doing here.

 

The median is the middle value of a range of numbers. Should there be an even number of numbers, the two middle values are added together and divided by two.

 

Mathematics lesson over (Y).

Link to comment
https://forums.phpfreaks.com/topic/264292-median-price/#findComment-1354404
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.