markmfredrickson/RItools — Issue #11: one and two sided confidence intervals
Author: jwbowers
Created: 2011-10-23 14:01:11+00:00
State: open

How should we support one-sided confidence intervals? Right now the code uses the two tailed p value and excludes the hypothesis from the interval if (1-p) > level where p is the two-tailed p. I hesitate to just add a `switch` or set of `if` to the nice edifice that Mark is building. Yet spawning mini-methods seems inelegant. So I have not taken this simple task into my own hands ---- yet I think we'll want this capability.

Here is the current code (from the commit of the randomization distribution branch before Mark did the big change):

```
confint.ParameterizedRandomizationDistribution <- function(
object,
param,
level = 0.95,
p.value.function = general.two.sided.p.value) {

pvs <- p.values(object, p.value.function)

reject <- (1 - pvs$p) > level
results <- cbind(object@params, reject[-1]) # drop the null

return(new("ParameterizedRandomizationDistributionConfInt", prd = object,
rejections = results))
}
```