confint-rctsimple: Confidence Intervals for Objects' Parameters

Description Usage Arguments Details Value Examples

Description

Calculates confidence intervals for one or more parameters in an effect size measure object. Package rctsimple adds methods for prevalence_difference and prevalence_ratio objects.

Usage

1
2
3
4
5
6
7
## S3 method for class 'prevalence_difference'
confint(object, parm = "estimate",
  level = 0.95, ...)

## S3 method for class 'prevalence_ratio'
confint(object, parm = "estimate", level = 0.95,
  ...)

Arguments

object

an object containing an effect size estimate (and possibly other parameters). Methods currently exist for the classes prevalence_difference and prevalence_ratio.

parm

Vector of names specifying which parameters' confidence intervals, are to be calculated for. Defaults to just calculating the confidence interval for the effect size estimate. Valid options are c("estimate", "p_group1", "p_group2")

level

Confidence level for confidence intervals to be calculated at.

...

additional argument(s) for methods (provided for consistency with generic)

Details

confint is a generic function in the package stats.

These confint methods calculate the relevant confidence intervals for the objects created in the rctsimple package.

The ... argument is included for consistency with the confint definition in stats (and MASS). No additional arguments are used by the methods provided in this package.

Value

A matrix (or vector) with columns giving lower and upper confidence limits for each parameter. These will be labelled as (1 - level) / 2 and 1 - (1 - level) / 2 in % (by default 2.5% and 97.5%).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
dummy_rct_data_list   <- list(group1_t = 48, group1_f = 52,
                              group2_t = 64, group2_f = 36)
pd <- prevalence_difference(outcome_data = dummy_rct_data_list,
                      groups = c("Control group", "Intervention group"),
                      outcomes = c("Outcome occurred", "Outcome did not occur"))
pr <- prevalence_ratio(outcome_data = dummy_rct_data_list,
                      groups = c("Control group", "Intervention group"),
                      outcomes = c("Outcome occurred", "Outcome did not occur"))
confint(pd, c("estimate","p_group1","p_group2"))
confint(pr, c("estimate","p_group1","p_group2"))

jimvine/rctsimple documentation built on May 19, 2019, 10:35 a.m.