probsens: Probabilistic sensitivity analysis.

Description Usage Arguments Value References Examples

View source: R/probsens.R

Description

Probabilistic sensitivity analysis to correct for exposure misclassification or outcome misclassification and random error. Non-differential misclassification is assumed when only the two bias parameters seca.parms and spca.parms are provided. Adding the 2 parameters seexp.parms and spexp.parms (i.e. providing the 4 bias parameters) evaluates a differential misclassification.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
probsens(
  case,
  exposed,
  type = c("exposure", "outcome"),
  reps = 1000,
  seca.parms = list(dist = c("constant", "uniform", "triangular", "trapezoidal",
    "logit-logistic", "logit-normal", "beta"), parms = NULL),
  seexp.parms = NULL,
  spca.parms = list(dist = c("constant", "uniform", "triangular", "trapezoidal",
    "logit-logistic", "logit-normal", "beta"), parms = NULL),
  spexp.parms = NULL,
  corr.se = NULL,
  corr.sp = NULL,
  discard = TRUE,
  alpha = 0.05
)

Arguments

case

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

exposed

Exposure variable.

type

Choice of correction for exposure or outcome misclassification.

reps

Number of replications to run.

seca.parms

List defining:

  1. The sensitivity of exposure classification among those with the outcome (when type = "exposure"), or

  2. The sensitivity of outcome classification among those with the exposure (when type = "outcome").

The first argument provides the probability distribution function (constant, uniform, triangular, trapezoidal, logit-logistic, logit-normal, or beta) and the second its parameters as a vector. Logit-logistic and logit-normal distributions can be shifted by providing lower and upper bounds. Avoid providing these values if a non-shifted distribution is desired.

  1. constant: constant value,

  2. uniform: min, max,

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

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

  5. logit-logistic: location, scale, lower bound shift, upper bound shift,

  6. logit-normal: location, scale, lower bound shift, upper bound shift.

  7. beta: alpha, beta.

seexp.parms

List defining:

  1. The sensitivity of exposure classification among those without the outcome (when type = "exposure"), or

  2. The sensitivity of outcome classification among those without the exposure (when type = "outcome").

spca.parms

List as above for seca.parms but for specificity.

spexp.parms

List as above for seexp.parms but for specificity.

corr.se

Correlation between case and non-case sensitivities.

corr.sp

Correlation between case and non-case specificities.

discard

A logical scalar. In case of negative adjusted count, should the draws be discarded? If set to FALSE, negative counts are set to zero.

alpha

Significance level.

Value

A list with elements:

obs.data

The analyzed 2 x 2 table from the observed data.

obs.measures

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

adj.measures

A table of corrected relative risks and odds ratios.

sim.df

Data frame of random parameters and computed values.

reps

Number of replications.

References

Lash, T.L., Fox, M.P, Fink, A.K., 2009 Applying Quantitative Bias Analysis to Epidemiologic Data, pp.117–150, Springer.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# The data for this example come from:
# Greenland S., Salvan A., Wegman D.H., Hallock M.F., Smith T.J.
# A case-control study of cancer mortality at a transformer-assembly facility.
# Int Arch Occup Environ Health 1994; 66(1):49-54.
set.seed(123)
# Exposure misclassification, non-differential
probsens(matrix(c(45, 94, 257, 945),
dimnames = list(c("BC+", "BC-"), c("Smoke+", "Smoke-")), nrow = 2, byrow = TRUE),
type = "exposure",
reps = 20000,
seca.parms = list("trapezoidal", c(.75, .85, .95, 1)),
spca.parms = list("trapezoidal", c(.75, .85, .95, 1)))

# Exposure misclassification, differential
probsens(matrix(c(45, 94, 257, 945),
dimnames = list(c("BC+", "BC-"), c("Smoke+", "Smoke-")), nrow = 2, byrow = TRUE),
type = "exposure",
reps = 20000,
seca.parms = list("trapezoidal", c(.75, .85, .95, 1)),
seexp.parms = list("trapezoidal", c(.7, .8, .9, .95)),
spca.parms = list("trapezoidal", c(.75, .85, .95, 1)),
spexp.parms = list("trapezoidal", c(.7, .8, .9, .95)),
corr.se = .8,
corr.sp = .8)

probsens(matrix(c(45, 94, 257, 945),
dimnames = list(c("BC+", "BC-"), c("Smoke+", "Smoke-")), nrow = 2, byrow = TRUE),
type = "exposure",
reps = 20000,
seca.parms = list("beta", c(908, 16)),
seexp.parms = list("beta", c(156, 56)),
spca.parms = list("beta", c(153, 6)),
spexp.parms = list("beta", c(205, 18)),
corr.se = .8,
corr.sp = .8)

probsens(matrix(c(338, 490, 17984, 32024),
dimnames = list(c("BC+", "BC-"), c("Smoke+", "Smoke-")), nrow = 2, byrow = TRUE),
type = "exposure",
reps = 1000,
seca.parms = list("trapezoidal", c(.8, .9, .9, 1)),
spca.parms = list("trapezoidal", c(.8, .9, .9, 1)))

# Disease misclassification
probsens(matrix(c(173, 602, 134, 663),
dimnames = list(c("BC+", "BC-"), c("Smoke+", "Smoke-")), nrow = 2, byrow = TRUE),
type = "outcome",
reps = 20000,
seca.parms = list("uniform", c(.8, 1)),
spca.parms = list("uniform", c(.8, 1)))

probsens(matrix(c(338, 490, 17984, 32024),
dimnames = list(c("BC+", "BC-"), c("Smoke+", "Smoke-")), nrow = 2, byrow = TRUE),
type = "outcome",
reps = 20000,
seca.parms = list("uniform", c(.2, .6)),
seexp.parms = list("uniform", c(.1, .5)),
spca.parms = list("uniform", c(.99, 1)),
spexp.parms = list("uniform", c(.99, 1)),
corr.se = .8,
corr.sp = .8)

probsens(matrix(c(173, 602, 134, 663),
dimnames = list(c("BC+", "BC-"), c("Smoke+", "Smoke-")), nrow = 2, byrow = TRUE),
type = "outcome",
reps = 20000,
seca.parms = list("beta", c(100, 5)),
seexp.parms = list("beta", c(110, 10)),
spca.parms = list("beta", c(120, 15)),
spexp.parms = list("beta", c(130, 30)),
corr.se = .8,
corr.sp = .8)

Example output

Chosen prior Se/Sp distributions lead to 814 negative adjusted counts which were discarded.
--Observed data-- 
         Outcome: BC+ 
       Comparing: Smoke+ vs. Smoke- 

    Smoke+ Smoke-
BC+     45     94
BC-    257    945

                                      2.5%    97.5%
 Observed Relative Risk: 1.646999 1.182429 2.294094
    Observed Odds Ratio: 1.760286 1.202457 2.576898
---
                                                 Median 2.5th percentile
           Relative Risk -- systematic error:  2.187555         1.738520
              Odds Ratio -- systematic error:  2.470164         1.872967
Relative Risk -- systematic and random error:  2.255773         1.422060
   Odds Ratio -- systematic and random error:  2.564989         1.492476
                                              97.5th percentile
           Relative Risk -- systematic error:          6.515802
              Odds Ratio -- systematic error:         13.871040
Relative Risk -- systematic and random error:          6.634863
   Odds Ratio -- systematic and random error:         14.075772
Chosen prior Se/Sp distributions lead to 4350 negative adjusted counts which were discarded.
--Observed data-- 
         Outcome: BC+ 
       Comparing: Smoke+ vs. Smoke- 

    Smoke+ Smoke-
BC+     45     94
BC-    257    945

                                      2.5%    97.5%
 Observed Relative Risk: 1.646999 1.182429 2.294094
    Observed Odds Ratio: 1.760286 1.202457 2.576898
---
                                                 Median 2.5th percentile
           Relative Risk -- systematic error:  2.908202         1.683460
              Odds Ratio -- systematic error:  3.519741         1.809253
Relative Risk -- systematic and random error:  2.987914         1.515994
   Odds Ratio -- systematic and random error:  3.641237         1.606902
                                              97.5th percentile
           Relative Risk -- systematic error:          9.889558
              Odds Ratio -- systematic error:         44.440281
Relative Risk -- systematic and random error:         10.290981
   Odds Ratio -- systematic and random error:         45.089822
Chosen prior Se/Sp distributions lead to 20000 negative adjusted counts which were discarded.
--Observed data-- 
         Outcome: BC+ 
       Comparing: Smoke+ vs. Smoke- 

    Smoke+ Smoke-
BC+     45     94
BC-    257    945

                                      2.5%    97.5%
 Observed Relative Risk: 1.646999 1.182429 2.294094
    Observed Odds Ratio: 1.760286 1.202457 2.576898
---
                                              Median 2.5th percentile
           Relative Risk -- systematic error:                        
              Odds Ratio -- systematic error:                        
Relative Risk -- systematic and random error:                        
   Odds Ratio -- systematic and random error:                        
                                              97.5th percentile
           Relative Risk -- systematic error:                  
              Odds Ratio -- systematic error:                  
Relative Risk -- systematic and random error:                  
   Odds Ratio -- systematic and random error:                  
Warning message:
In probsens(matrix(c(45, 94, 257, 945), dimnames = list(c("BC+",  :
  Prior Se/Sp distributions lead to all negative adjusted counts.
--Observed data-- 
         Outcome: BC+ 
       Comparing: Smoke+ vs. Smoke- 

    Smoke+ Smoke-
BC+    338    490
BC-  17984  32024

                                      2.5%    97.5%
 Observed Relative Risk: 1.224104 1.066961 1.404390
    Observed Odds Ratio: 1.228315 1.068081 1.412589
---
                                                Median 2.5th percentile
           Relative Risk -- systematic error: 1.298245         1.246925
              Odds Ratio -- systematic error: 1.304096         1.251625
Relative Risk -- systematic and random error: 1.295969         1.122475
   Odds Ratio -- systematic and random error: 1.301775         1.124729
                                              97.5th percentile
           Relative Risk -- systematic error:          1.382128
              Odds Ratio -- systematic error:          1.390072
Relative Risk -- systematic and random error:          1.508913
   Odds Ratio -- systematic and random error:          1.519908
Chosen prior Se/Sp distributions lead to 3170 negative adjusted counts which were discarded.
--Observed data-- 
         Outcome: BC+ 
       Comparing: Smoke+ vs. Smoke- 

    Smoke+ Smoke-
BC+    173    602
BC-    134    663

                                      2.5%    97.5%
 Observed Relative Risk: 1.184136 1.056368 1.327359
    Observed Odds Ratio: 1.421865 1.106140 1.827708
---
                                                Median 2.5th percentile
           Relative Risk -- systematic error: 1.223300         1.185856
              Odds Ratio -- systematic error: 1.549871         1.443997
Relative Risk -- systematic and random error: 1.226206         1.084866
   Odds Ratio -- systematic and random error: 1.555315         1.196404
                                              97.5th percentile
           Relative Risk -- systematic error:          1.280681
              Odds Ratio -- systematic error:          1.701256
Relative Risk -- systematic and random error:          1.388923
   Odds Ratio -- systematic and random error:          2.030863
Chosen prior Se/Sp distributions lead to 13943 negative adjusted counts which were discarded.
--Observed data-- 
         Outcome: BC+ 
       Comparing: Smoke+ vs. Smoke- 

    Smoke+ Smoke-
BC+    338    490
BC-  17984  32024

                                      2.5%    97.5%
 Observed Relative Risk: 1.224104 1.066961 1.404390
    Observed Odds Ratio: 1.228315 1.068081 1.412589
---
                                                 Median 2.5th percentile
           Relative Risk -- systematic error: 1.1140667        0.7525900
              Odds Ratio -- systematic error: 1.1175360        0.7466671
Relative Risk -- systematic and random error: 1.1172774        0.7348427
   Odds Ratio -- systematic and random error: 1.1211227        0.7297241
                                              97.5th percentile
           Relative Risk -- systematic error:         1.7925982
              Odds Ratio -- systematic error:         1.8141704
Relative Risk -- systematic and random error:         1.8344230
   Odds Ratio -- systematic and random error:         1.8573866
Chosen prior Se/Sp distributions lead to 20000 negative adjusted counts which were discarded.
--Observed data-- 
         Outcome: BC+ 
       Comparing: Smoke+ vs. Smoke- 

    Smoke+ Smoke-
BC+    173    602
BC-    134    663

                                      2.5%    97.5%
 Observed Relative Risk: 1.184136 1.056368 1.327359
    Observed Odds Ratio: 1.421865 1.106140 1.827708
---
                                              Median 2.5th percentile
           Relative Risk -- systematic error:                        
              Odds Ratio -- systematic error:                        
Relative Risk -- systematic and random error:                        
   Odds Ratio -- systematic and random error:                        
                                              97.5th percentile
           Relative Risk -- systematic error:                  
              Odds Ratio -- systematic error:                  
Relative Risk -- systematic and random error:                  
   Odds Ratio -- systematic and random error:                  
Warning message:
In probsens(matrix(c(173, 602, 134, 663), dimnames = list(c("BC+",  :
  Prior Se/Sp distributions lead to all negative adjusted counts.

episensr documentation built on Aug. 20, 2021, 9:06 a.m.