Compute risk ratio and uncertainty by fitting binomial models to counts of events relative to possible number of events. The risk ratio is the ratio of the probability of an event under the model fit to the first dataset to the probability under the model fit to the second dataset. Default standard errors are based on the usual MLE asymptotics using a delta-method-based approximation, but standard errors based on the nonparametric bootstrap and on a likelihood ratio procedure can also be computed.

1 2 3 |

`y` |
vector of two values, the number of events in the two scenarios |

`n` |
vector of two values, the number of samples (possible occurrences of events) in the two scenarios |

`ciLevel` |
statistical confidence level for confidence intervals; in repeated experimentation, this proportion of confidence intervals should contain the true risk ratio. Note that if only one endpoint of the resulting interval is used, for example the lower bound, then the effective confidence level increases by half of one minus |

`bootSE` |
logical indicating whether to use the bootstrap to estimate standard errors. |

`bootControl` |
a list of control parameters for the bootstrapping. See |

`lrtCI` |
logical indicating whether to calculate a likelihood ratio-based confidence interval |

`lrtControl` |
list containing a single component, |

See `fit_pot`

for information on the `bootControl`

argument.

Christopher J. Paciorek

Paciorek et al. methods paper being finalized.

1 2 | ```
calc_riskRatio_binom(c(4,0), rep(100, 2), bootSE = FALSE, lrtCI = TRUE)
calc_riskRatio_binom(c(40, 8), rep(400, 2), bootSE = TRUE, lrtCI = TRUE)
``` |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.