Learn R Programming

episensr (version 2.1.0)

selection: Selection bias.

Description

selection() and probsens_sel() allow to provide adjusted measures of association corrected for selection bias.

Usage

selection(case, exposed, bias_parms = NULL, alpha = 0.05)

probsens_sel( case, exposed, reps = 1000, case_exp = list(dist = c("constant", "uniform", "triangular", "trapezoidal", "normal", "beta"), parms = NULL), case.exp = deprecated(), case_nexp = list(dist = c("constant", "uniform", "triangular", "trapezoidal", "normal", "beta"), parms = NULL), case.nexp = deprecated(), ncase_exp = list(dist = c("constant", "uniform", "triangular", "trapezoidal", "normal", "beta"), parms = NULL), ncase.exp = deprecated(), ncase_nexp = list(dist = c("constant", "uniform", "triangular", "trapezoidal", "normal", "beta"), parms = NULL), ncase.nexp = deprecated(), alpha = 0.05 )

Value

A list with elements:

model

Bias analysis performed.

obs_data

The analyzed 2 x 2 table from the observed data.

corr_data

The same table corrected for selection proportions.

obs_measures

A table of odds ratios and relative risk with confidence intervals.

adj_measures

Selection bias corrected measures of outcome-exposure relationship.

bias_parms

Input bias parameters: selection probabilities.

selbias_or

Selection bias odds ratio based on the bias parameters chosen.

A list with elements (for probsens_sel()):

obs_data

The analyzed 2 x 2 table from the observed data.

obs_measures

A table of observed odds ratio with confidence intervals.

adj_measures

A table of corrected odds ratios.

sim_df

Data frame of random parameters and computed values.

reps

Number of replications.

Arguments

case

Outcome variable. If a variable, this variable is tabulated against.

exposed

Exposure variable.

bias_parms

Selection probabilities. Either a vector of 4 elements between 0 and 1 defining the following probabilities in this order can be provided:

  1. Selection probability among cases exposed (1),

  2. Selection probability among cases unexposed (2),

  3. Selection probability among noncases exposed (3), and

  4. Selection probability among noncases unexposed (4).

or a single positive selection-bias factor which is the ratio of the exposed versus unexposed selection probabilities comparing cases and noncases ((14)/(23) from above).

alpha

Significance level.

reps

Number of replications to run.

case_exp

If or_parms not provided, defines the selection probability among case exposed. The first argument provides the probability distribution function and the second its parameters as a vector:

  1. constant: constant value,

  2. uniform: min, max,

  3. triangular: lower limit, upper limit, mode,

  4. trapezoidal: min, lower mode, upper mode, max.

  5. normal: truncated normal with lower bound, upper bound, mean, sd,

  6. beta: alpha, beta.

case.exp

Deprecated. Please use case_exp.

case_nexp

Same among cases non-exposed.

case.nexp

Deprecated. Please use case_nexp.

ncase_exp

Same among non-cases exposed.

ncase.exp

Deprecated. Please use ncase_exp.

ncase_nexp

Same among non-cases non-exposed.

ncase.nexp

Deprecated. Please use ncase_nexp.

Simple bias analysis with <code>selection()</code>

selection() allows you to run a simple sensitivity analysis to correct for selection bias using estimates of the selection proportions.

Probabilistic sensitivity analysis with <code>probsens_sel()</code>

probsens_sel() performs a summary-level probabilistic sensitivity analysis to correct for selection bias.

References

Fox, M.P, MacLehose, R.F., Lash, T.L., 2021 Applying Quantitative Bias Analysis to Epidemiologic Data, pp.90--91, 274--279, Springer.

See Also

Other selection: mbias()

Examples

Run this code
# The data for this example come from:
# Stang A., Schmidt-Pokrzywniak A., Lehnert M., Parkin D.M., Ferlay J., Bornfeld N.
# et al.
# Population-based incidence estimates of uveal melanoma in Germany. Supplementing
# cancer registry data by case-control data.
# Eur J Cancer Prev 2006;15:165-70.
selection(matrix(c(136, 107, 297, 165),
dimnames = list(c("UM+", "UM-"), c("Mobile+", "Mobile-")),
nrow = 2, byrow = TRUE),
bias_parms = c(.94, .85, .64, .25))


selection(matrix(c(136, 107, 297, 165),
dimnames = list(c("UM+", "UM-"), c("Mobile+", "Mobile-")),
nrow = 2, byrow = TRUE),
bias_parms = 0.43)
#
# The data for this example come from:
# Stang A., Schmidt-Pokrzywniak A., Lehnert M., Parkin D.M., Ferlay J., Bornfeld N. et al.
# Population-based incidence estimates of uveal melanoma in Germany.
# Supplementing cancer registry data by case-control data.
# Eur J Cancer Prev 2006;15:165-70.
set.seed(1234)
probsens_sel(matrix(c(139, 114, 369, 377),
dimnames = list(c("Melanoma+", "Melanoma-"), c("Mobile+", "Mobile-")), nrow = 2, byrow = TRUE),
reps = 5000,
case_exp = list("beta", c(139, 5.1)),
case_nexp = list("beta", c(114, 11.9)),
ncase_exp = list("beta", c(369, 96.1)),
ncase_nexp = list("beta", c(377, 282.9)))

Run the code above in your browser using DataLab