tdasci: t-distribution asymptotic score ("TDAS") confidence intervals...

Description Usage Arguments Value

View source: R/scoreci.R

Description

Wrapper function for the TDAS method. Score-based stratified confidence intervals for the rate (or risk) difference ("RD") or ratio ("RR") for independent binomial or Poisson rates, or for odds ratio ("OR", binomial only), or for prevalence or incidence rate ("p"). This function combines vector inputs into a single stratified random effects analysis (e.g. meta-analysis), incorporating any stratum variability into the confidence interval.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
tdasci(
  x1,
  n1,
  x2 = NULL,
  n2 = NULL,
  distrib = "bin",
  contrast = "RD",
  level = 0.95,
  cc = FALSE,
  theta0 = NULL,
  precis = 6,
  plot = FALSE,
  hetplot = FALSE,
  plotmax = 100,
  xlim = NULL,
  ylim = NULL,
  weighting = NULL,
  MNtol = 1e-08,
  wt = NULL,
  skew = TRUE,
  prediction = FALSE,
  warn = TRUE,
  ...
)

Arguments

x1, x2

Numeric vectors of numbers of events in group 1 & group 2 respectively.

n1, n2

Numeric vectors of sample sizes (for binomial rates) or exposure times (for Poisson rates) in each group.

distrib

Character string indicating distribution assumed for the input data: "bin" = binomial (default), "poi" = Poisson.

contrast

Character string indicating the contrast of interest: "RD" = rate difference (default), "RR" = rate ratio, "OR" = odds ratio. contrast="p" gives an interval for the single proportion or rate x1/n1.

level

Number specifying confidence level (between 0 and 1, default 0.95).

cc

Number or logical (default FALSE) specifying (amount of) continuity correction. Numeric value is taken as the gamma parameter in Laud 2017, Appendix S2 (default 0.5 if cc = TRUE). IMPORTANT NOTES: 1) This is a 'continuity correction' aimed at approximating strictly conservative coverage, NOT for dealing with zero cell counts. Such 'sparse data adjustments' are not needed in the score method, except to deal with double-zero cells for RD (& double-100 binomial RD & RR) with IVS/INV weights. 2) The continuity corrections provided here have not been fully tested for stratified methods.

theta0

Number to be used in a one-sided significance test (e.g. non-inferiority margin). 1-sided p-value will be <0.025 iff 2-sided 95% CI excludes theta0. By default, a two-sided test against theta0 = 0 (for RD) or 1 (for RR/OR) is also output.

precis

Number (default 6) specifying precision (i.e. number of decimal places) to be used in optimisation subroutine for the confidence interval.

plot

Logical (default FALSE) indicating whether to output plot of the score function

hetplot

Logical (default FALSE) indicating whether to output plots for evaluating heterogeneity of stratified datasets.

plotmax

Numeric value indicating maximum value to be displayed on x-axis of plots (useful for ratio contrasts which can be infinite).

xlim

pair of values indicating range of values to be plotted.

ylim

pair of values indicating range of values to be plotted.

weighting

String indicating which weighting method to use if stratified = "TRUE": "IVS" = Inverse Variance of Score (see Laud 2017 for details), "INV" = Inverse Variance (bcf omitted, default for contrast = "OR"), "MH" = Mantel-Haenszel (default for contrast = "RD" or "RR"), "MN" = Miettinen-Nurminen iterative weights. For CI consistent with a CMH test, select skew = FALSE and use MH weighting for RD/RR and IVS for OR.

MNtol

Numeric value indicating convergence tolerance to be used in iteration with weighting = "MN".

wt

Numeric vector containing (optional) user-specified weights.

skew

Logical (default TRUE) indicating whether to apply skewness correction (for the SCAS method recommended in Laud 2017) or not (for the Miettinen-Nurminen method) to the per-stratum estimates provided in the output. Has no effect on the TDAS interval itself.

prediction

Logical (default FALSE) indicating whether to produce a prediction interval (work in progress).

warn

Logical (default TRUE) giving the option to suppress warnings.

...

Other arguments.

Value

A list containing the following components:

estimates

a matrix containing estimates of the rates in each group and of the requested contrast, with its confidence interval

pval

a matrix containing details of the corresponding 2-sided significance test against the null hypothesis that p_1 = p_2, and one-sided significance tests against the null hypothesis that theta >= or <= theta0

Qtest

a vector of values describing and testing heterogeneity

weighting

a string indicating the selected weighting method

stratdata

a matrix containing stratum estimates and weights

call

details of the function call


ratesci documentation built on Dec. 11, 2021, 9:36 a.m.