statsmodels/statsmodels — pull request #2021 by phobson (2014-10-02 04:04:24+00:00)
Title: ENH: Added censored data analysis module with RobustROS fitter and tests

## Preface
I'm not sure that this fits here. I originally had the go-ahead to add it to `lifelines`, but that license got a funny
and I'd prefer to not get into that mess.

## Overview
In the environment, we can nearly never say that a certain parameter doesn't exist. Instead, we say that it was non-detected, and report a detection limit that corresponds to the lowest possible quantifiable value of the instrument and/or measurement method. You can think about this a measuring the diameter of hair with a rule. You know the hairs have diameters, and you know they're <1 mm, but that's about all you can say.

So trying to compute basic stats about these data sets can be tricky. Luckily Dr. Helsel wrote a couple of text books about how to deal with this. [Here is the one I used to write this code](http://www.amazon.com/Nondetects-Data-Analysis-Statistics-Environmental/dp/0471671738).

Also [here's a overview paper](http://training.fws.gov/resources/course-resources/pesticides/Monitoring/USGS%20Nondetects%20water%20sampling%20bias.pdf) and an (R-package)[http://cran.r-project.org/web/packages/NADA/index.html] written by I believe a colleague of Helsel.

## Tests
I got a lot of them. Coverage was 100% on my local machine. A lot of them are redundant, but check things like what should happen when >80% of values are censored, or if all but 1 values are censored, etc.

Most of the tests use known values that come from either text book or papers written by Helsel, or datasets and results that come from the R package.

## Future work
There's a lot more in the R-package that could easily be implemented in python. This is just the start.