[SciPy-User] Standard error of the mean for weighted data

Ramon Crehuet rcsqtc at iqac.csic.es
Wed Jan 22 05:46:31 EST 2014


Dear all,
I would like to calculate the standard error of the mean for data values that 
each has some (normalized) weight. I guess this cannot be done with 
scipy.stats.sem...
I thought of coding that, but I'm afraid I don't know what to code! For weighted 
data, the SEM cannot be std/sqrt(N), even if the std is calculated from the 
weighted data as explained here:
http://en.wikipedia.org/wiki/Weighted_arithmetic_mean
Imagine I have 1000 values, but only 2 have weights different from zero. It 
makes no sense to divide the weighted std by sqrt(1000). Right?
Any help or suggestion is welcome. (I also looked at scikits.bootstrap but I 
don't think I can define an array of weights anywhere).
Thanks in advance,
Ramon




More information about the SciPy-User mailing list