Skip to contents

Simple sensitivity analysis to correct for a misclassified covariate (a potential confounder or effect measure modifier).

Usage

misclassification.cov(
  case,
  exposed,
  covariate,
  bias_parms = NULL,
  alpha = 0.05
)

Arguments

case

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

exposed

Exposure variable.

covariate

Covariate to stratify on.

bias_parms

Vector defining the bias parameters. This vector has 4 elements between 0 and 1, in the following order:

  1. Sensitivity of confounder classification among those with the outcome,

  2. Sensitivity of confounder classification among those without the outcome,

  3. Specificity of confounder classification among those with the outcome,and

  4. Specificity of confounder classification among those without the outcome.

alpha

Significance level.

Value

A list with elements:

obs.data

The analyzed stratified 2 x 2 tables from the observed data.

corr.data

The expected stratified observed data given the true data assuming misclassification.

obs.measures

A table of observed relative risk and odds ratio with confidence intervals.

adj.measures

A table of adjusted relative risk and odds ratio.

bias.parms

Input bias parameters.

References

Lash, T.L., Fox, M.P, Fink, A.K., 2009 Applying Quantitative Bias Analysis to Epidemiologic Data, pp.79--108, Springer.

Examples

# The data for this example come from:
# Berry, R.J., Kihlberg, R., and Devine, O. Impact of misclassification of in vitro
# fertilisation in studies of folic acid and twinning: modelling using population
# based Swedish vital records.
# BMJ, doi:10.1136/bmj.38369.437789.82 (published 17 March 2004)
misclassification.cov(array(c(1319, 38054, 5641, 405546,
565, 3583, 781, 21958,
754, 34471, 4860, 383588),
dimnames = list(c("Twins+", "Twins-"),
c("Folic acid+", "Folic acid-"), c("Total", "IVF+", "IVF-")),
dim = c(2, 2, 3)),
bias_parms = c(.6, .6, .95, .95))
#> --Observed data-- 
#>          Outcome: Twins+ 
#>        Comparing: Folic acid+ vs. Folic acid- 
#> 
#> , , Total
#> 
#>        Folic acid+ Folic acid-
#> Twins+        1319        5641
#> Twins-       38054      405546
#> 
#> , , IVF+
#> 
#>        Folic acid+ Folic acid-
#> Twins+         565         781
#> Twins-        3583       21958
#> 
#> , , IVF-
#> 
#>        Folic acid+ Folic acid-
#> Twins+         754        4860
#> Twins-       34471      383588
#> 
#> 
#>                                      2.5%    97.5%
#> Observed Relative Risk: 2.441910 2.301898 2.590437
#>    Observed Odds Ratio: 2.491888 2.344757 2.648251
#> ---
#>                                                       Observed Corrected
#>                       SMR RR adjusted for confounder: 2.261738  1.000235
#>    RR due to confounding by misclassified confounder: 1.079661  2.441337
#>           Mantel-Haenszel RR adjusted for confounder: 2.228816  1.000187
#> MH RR due to confounding by misclassified confounder: 1.095608  2.441452
#>                       SMR OR adjusted for confounder: 2.337898  1.000304
#>    OR due to confounding by misclassified confounder: 1.065867  2.491131
#>           Mantel-Haenszel OR adjusted for confounder: 2.290469  1.000215
#> MH OR due to confounding by misclassified confounder: 1.087938  2.491351