How do I calculate a median in MathCad for a large skewed distribution of numbers such as particle sizes.
Sort the values. If the number of values is odd, pick the middle one. If it's even, take the average of the two middle values.
Have a look at the attached worksheet.
Mike
The attached program works, but I have just learnt that Mathcad has a built "Median" function, therefore as Richard says sort the data and apply the median function.
Message was edited by: Mike Armstrong
You don't need to sort all the values to find the median, just the half or half + 1 of the data ...
Well, that's if you want to play, probably the compiled mathcad sort is faster than any for loop, isn't?
Cheers. Alvaro.
You don't need to sort all the values to find the median, just the half or half + 1 of the data ...
Of course.
Well, that's if you want to play, probably the compiled mathcad sort is faster than any for loop, isn't?
Yes. After all these years of using Mathcad I never knew it had a "Median" function. What a waste of time producing that program.
Mike
DAEP have median function. Check Help / Data Analysis ... / Descriptive Statiscs / Location. Excel have median too.
Also the median have the propertie that minimizes the average of the absolute deviations, like the mean and others central parameters.
Problem with the median is that not always a unique median exists ... a detail, for say.
Regards. Alvaro.
DAEP have median function. Check Help / Data Analysis ... / Descriptive Statiscs / Location. Excel have median too.
Has the median function only been added in M15 then?
Mike
It existed even in MC11; I just checked.
Little bit embarrassed I've missed that since M11
Mike
After all these years of using Mathcad I never knew it had a "Median" function.
I missed that too
What a waste of time producing that program.
Think of it as an educational experience
Richard Jackson wrote:
Think of it as an educational experience
It is seems absolutely deprecated. Can´t find it in places like http://www.itl.nist.gov/div898/handbook/dtoc.htm (use Ctrl+F for search) even it is in the usual language: http://externalsearch.nist.gov/search?q=median&btnG=Google+Search&site=itl_sed_hndbk_collec&output=xml_no_dtd&client=default_frontend&sort=date:D:L:d1&proxystylesheet=default_frontend&oe=UTF-8 shows 89 results.
So, maybe the collab that was the original post can tell us for what needs the median. I assume a practicual use for the median for discarding values, but I'm usually discard a lot of values if the data set is enough big because I assume always a big human factor in measures, so can't trust very much in my techniques doing this.
Regards. Alvaro.