scasci | R Documentation |
Wrapper function for the SCAS method. Score-based 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 the single rate ("p"). (This is the "GNbc" method from Laud & Dane, developed from Gart & Nam, and generalised as "SCAS" in Laud 2017) including optional continuity adjustment. This function is vectorised in x1, x2, n1, and n2. Vector inputs may also be combined into a single stratified analysis (e.g. meta-analysis). This method assumes the contrast is constant across strata (fixed effects). For a 'random-effects' method use tdasci (or scoreci with random = TRUE).
scasci(
x1,
n1,
x2 = NULL,
n2 = NULL,
distrib = "bin",
contrast = "RD",
level = 0.95,
cc = FALSE,
theta0 = NULL,
precis = 6,
plot = FALSE,
hetplot = FALSE,
xlim = NULL,
ylim = NULL,
plotmax = 100,
stratified = FALSE,
weighting = NULL,
mn_tol = 1e-08,
MNtol = NULL,
wt = NULL,
warn = TRUE,
...
)
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: |
contrast |
Character string indicating the contrast of interest: |
level |
Number specifying confidence level (between 0 and 1, default 0.95). |
cc |
Number or logical (default FALSE) specifying (amount of) continuity
adjustment. Numeric value between 0 and 0.5 is taken as the gamma parameter
in Laud 2017, Appendix S2 (
|
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\ 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. |
xlim |
pair of values indicating range of values to be plotted. |
ylim |
pair of values indicating range of values to be plotted. |
plotmax |
Numeric value indicating maximum value to be displayed on x-axis of plots (useful for ratio contrasts which can be infinite). |
stratified |
Logical (default FALSE) indicating whether to combine
vector inputs into a single stratified analysis. |
weighting |
String indicating which weighting method to use if
stratified = "TRUE": |
mn_tol |
Numeric value indicating convergence tolerance to be used in iteration with weighting = "MN". |
MNtol |
(deprecated: argument renamed to mn_tol) |
wt |
Numeric vector containing (optional) user-specified weights. |
warn |
Logical (default TRUE) giving the option to suppress warnings. |
... |
Other arguments. |
A list containing the following components:
a matrix containing estimates of the rates in each group and of the requested contrast, with its confidence interval
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
details of the function call
If stratified = TRUE, the following outputs are added:
a vector of values describing and testing heterogeneity
a string indicating the selected weighting method
a matrix containing stratum estimates and weights
Pete Laud, p.j.laud@sheffield.ac.uk
Laud PJ. Equal-tailed confidence intervals for comparison of rates. Pharmaceutical Statistics 2017; 16:334-348.
Laud PJ. Corrigendum: Equal-tailed confidence intervals for comparison of rates. Pharmaceutical Statistics 2018; 17:290-293.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.