weighted mean; weighted standard error of the mean (sem)

C

C Barrington-Leigh

I am looking for some reaally basic statistical tools. I have some
sample data, some sample weights for those measurements, and I want to
calculate a mean and a standard error of the mean.

Here are obvious places to look:

numpy
scipy.stats
statsmodels

It seems to me that numpy's "mean" and "average" functions have their
names backwards. That is, often a mean is defined more generally than
average, and includes the possibility of weighting, but in this case
it is "average" that has a weights argument. Can these functions be
merged/renamed/deprecated in the future? It's clear to me that "mean"
should allow for weights.

None of these modules, above, offer standard error of the mean which
incorporates weights. numpy's "sem" doesn't, and that's the closest
thing. numpy's "var" doesn't allow weights.
There aren't any weighted variances in the above modules.

Again, are there favoured codes for these functions? Can they be
incorporated appropriately in the future?

Most immediately, I'd love to get code for weighted sem. I'll write it
otherwise, but if I do I'd love to know whom to bug to get it
incorporated into numpy.sem ...

Thanks!

None of them have this basic function. Has anyone written one?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,731
Messages
2,569,432
Members
44,832
Latest member
GlennSmall

Latest Threads

Top