keithw / biostat

Efficient routines for biostatistics
GNU Lesser General Public License v3.0
4 stars 0 forks source link

Vector of `breal` instead of `bool`? #1

Open shimenghuang opened 4 years ago

shimenghuang commented 4 years ago

Hi @keithw ,

I was wondering if ppv_cache_ was supposed to be initialized to a vector of breal instead of bool in BarnardFast here. My guess is that "ppv" stands for "particular p-value" as it is returned here, and with this, should this line assign cumulative_probability (a particular p-value) rather than cumulative_probability >= alpha to it? Without changing this, p_value from BarnardFast seems to be either 1 or gamma, but if I changed as described, it would give the p_value. Not sure if that was intended.

Thanks!

Shimeng

keithw commented 4 years ago

Hi Shimeng -- I don't think so! But BarnardFast is my own (unpublished) algorithm for computing many Barnard p-values at the same time. It can be useful if you want to calculate the curve of false-positive rates along the line of a composite null hypothesis. (E.g., what is the probability of getting p < .05 against equality if the true rates are both 0.02? Or 0.03? Or 0.04? Or 0.05? Etc.) This was used to make the graph on my web page (https://cs.stanford.edu/~keithw/ -- see the paragraph about the "exchange algorithm.")

Anyway, this is pretty esoteric stuff, and it's an unpublished algorithm -- you may want to just leave out the "BarnardFast" from your R package because I suspect it may just confuse people...