tags:

views:

113

answers:

1

I'm looking for something similar in form to weighted.mean(). Sorry for posting such a banal question... new to R. I've found some solutions via search that write out the entire function but would appreciate something a bit more user friendly.

+10  A: 

The following packages all have a function to calculate a weighted median: 'aroma.light', 'isotone', 'limma', 'cwhmisc' and 'ergm'.

To find them I used the invaluable findFn() in the 'sos' package which is an extension for R's inbuilt help.

findFn('weighted median')

Or,

???'weighted median'

as ??? is a shortcut in the same way ?some.function is for help(some.function)

wkmor1
I didn't know about findFn! That's awesome!
Bob Albright
You can also use ??? as you use ? or ??, still from sos package.
Etiennebr
Agreed on the findFn. Very useful. And rather than install a new package I just got some sleep. I'm just trying to calculate the median of weighted data and did this: median(rep(x, each=w)).
Michael Williams
Yep, median(rep(x, each=w)), would work too. But only if all your weights are integers.
wkmor1