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

Discussion in 'Python' started by C Barrington-Leigh, Sep 10, 2010.

  1. 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?
    C Barrington-Leigh, Sep 10, 2010
    #1
    1. Advertising

  2. C Barrington-Leigh

    Tim Leslie Guest

    On 10 September 2010 11:43, C Barrington-Leigh <> wrote:
    >
    >> The best place to ask about numpy related stuff is the numpy mailing list at:
    >>
    >> http://mail.scipy.org/mailman/listinfo/numpy-discussion
    >>
    >> This is also the best place to present a patch if you have code to
    >> contribute. In my experience the numpy devs are always happy to have
    >> new contributors, but be sure to discuss the problem first, as the
    >> folk over there might be able to provide a solution which doesn't
    >> require a new patch.

    >
    >
    > Thanks, Tim,
    >
    > Ooops -- the sem() I mentioned is  sciypy.stats.sem, not in numpy...
    > Does your advice hold?
    > Thanks,


    For discussion out that function you probably want the scipy-user
    mailing list. For completeness, here's the full list of related
    mailing lists:

    http://www.scipy.org/Mailing_Lists

    Cheers,

    Tim

    > c
    > --
    > http://mail.python.org/mailman/listinfo/python-list
    >
    Tim Leslie, Sep 10, 2010
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dan Peder Eriksen

    Maximum Weighted Matching Algorithm

    Dan Peder Eriksen, Aug 17, 2003, in forum: Java
    Replies:
    3
    Views:
    1,131
    Dan Peder Eriksen
    Aug 17, 2003
  2. HR Head
    Replies:
    0
    Views:
    533
    HR Head
    Dec 31, 2007
  3. sarah Fernandes
    Replies:
    0
    Views:
    319
    sarah Fernandes
    Mar 4, 2011
  4. shiman999
    Replies:
    1
    Views:
    134
    John Saunders [MVP]
    Aug 28, 2007
  5. Venks
    Replies:
    5
    Views:
    237
    Ken Bloom
    Dec 6, 2007
Loading...

Share This Page