Package 'mueRelativeRisk'

Title: Relative Risk Based on the Ratio of Median Unbiased Estimates
Description: Implements an estimator for relative risk based on the median unbiased estimator. The relative risk estimator is well defined and performs satisfactorily for a wide range of data configurations. The details of the method are available in Carter et al (2010) <doi:10.1111/j.1467-9876.2010.00711.x>.
Authors: Rickey Carter [aut, cre]
Maintainer: Rickey Carter <[email protected]>
License: GPL-3
Version: 0.1.1
Built: 2025-03-11 03:29:35 UTC
Source: https://github.com/rickeycarter/muerelativerisk

Help Index


Function to determine the MUE estimate based on the beta distribution.

Description

This function calculates the median unbiased estimate for a single proportion.

Usage

dobeta(n, y)

Arguments

n

Number of independent trials.

y

Number of successes.

Value

A number with the MUE estimate


Generate the exact bootstrap interval for the MUE estimate.

Description

This function enumerates the exact bootstrap confidence interval for the MUE-based estimate of the relative risk.

Usage

mue_confidence_interval(n1, p1, n2, p2, alpha)

Arguments

n1

Sample size for group 1.

p1

MUE estimate calculated by the dobeta function for group 1.

n2

Sample size for group 2.

p2

MUE estimate calculated by the dobeta function for group 2.

alpha

The significance level for the confidence interval.

Value

Returns a matrix of the upper and lower limits for the confidence interval.


Calculate relative risk based on ratio of median unbiased estimators.

Description

This function calculates an estimate of relative risk based on the ratio of two median unbiased estimates of proportions based on the work by Carter et al (2010). The relative risk will be in the order of Pr(Group 1) / Pr(Group 2).

Usage

mue_rr(n1, y1, n2, y2, alpha = 0.05)

Arguments

n1

Sample size for group 1.

y1

Number of events in group 1.

n2

Sample size for group 2.

y2

Number of events in group 2.

alpha

The significance level for the confidence interval. Default value is 0.05.

Value

A dataframe with the various components generated during the estimation along with the MUE-based estimate of the relative risk.

Examples

mue_rr(9,1,11,0)
mue_rr(9,1,11,0,0.05)
mue_rr(3,0,4,0,0.05)
mue_rr(12,1,15,1,0.15)