evalue: Compute an E-value for unmeasured confounding

Description Usage Arguments Details References Examples

View source: R/EValue.R

Description

Returns a data frame containing point estimates, the lower confidence limit, and the upper confidence limit on the risk ratio scale (possibly through an approximate conversion) as well as E-values for the point estimate and the confidence interval limit closer to the null.

Usage

1
evalue(est, lo = NA, hi = NA, se = NA, delta = 1, true = c(0, 1), ...)

Arguments

est

The effect estimate that was observed but which is suspected to be biased. A number of class "estimate" (constructed with RR(), OR(), HR(), OLS(), or MD(); for E-values for risk differences, see evalues.RD()).

lo

Optional. Lower bound of the confidence interval. If not an object of class "estimate", assumed to be on the same scale as est.

hi

Optional. Upper bound of the confidence interval. If not an object of class "estimate", assumed to be on the same scale as est.

se

The standard error of the point estimate, for est of class "OLS"

delta

The contrast of interest in the exposure, for est of class "OLS"

true

A number to which to shift the observed estimate to. Defaults to 1 for ratio measures (RR(), OR(), HR()) and 0 for additive measures (OLS(), MD()).

...

Arguments passed to other methods.

Details

An E-value for unmeasured confounding is minimum strength of association, on the risk ratio scale, that unmeasured confounder(s) would need to have with both the treatment and the outcome to fully explain away a specific treatment–outcome association, conditional on the measured covariates.

The estimate is converted appropriately before the E-value is calculated. See conversion functions for more details. The point estimate and confidence limits after conversion are returned, as is the E-value for the point estimate and the confidence limit closest to the proposed "true" value (by default, the null value.)

For an OLS() estimate, the E-value is for linear regression with a continuous exposure and outcome. Regarding the continuous exposure, the choice of delta defines essentially a dichotomization in the exposure between hypothetical groups of subjects with exposures equal to an arbitrary value c versus to another hypothetical group with exposures equal to c + delta.

For example, if resulting E-value is 2, this means that unmeasured confounder(s) would need to double the probability of a subject's having exposure equal to c + delta instead of c, and would also need to double the probability of being high versus low on the outcome, in which the cutoff for "high" versus "low" is arbitrary subject to some distributional assumptions (Chinn, 2000).

References

  1. Ding & VanderWeele (2016). Sensitivity analysis without assumptions. Epidemiology. 27(3), 368.

  2. VanderWeele & Ding (2017). Sensitivity analysis in observational research: Introducing the E-value. Annals of Internal Medicine. 27(3), 368.

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
# compute E-value for leukemia example in VanderWeele and Ding (2017)
evalue(RR(0.80), 0.71, 0.91)

# you can also pass just the point estimate
# and return just the E-value for the point estimate with summary()
summary(evalue(RR(0.80)))

# demonstrate symmetry of E-value
# this apparently causative association has same E-value as the above
summary(evalue(RR(1 / 0.80)))

# E-value for a non-null true value
summary(evalue(RR(2), true = 1.5))

## Hsu and Small (2013 Biometrics) Data
## sensitivity analysis after log-linear or logistic regression
head(lead)

## log linear model -- obtain the conditional risk ratio
lead.loglinear = glm(lead ~ ., family = binomial(link = "log"),
                         data = lead[,-1])
est_se = summary(lead.loglinear)$coef["smoking", c(1, 2)]

est      = RR(exp(est_se[1]))
lowerRR  = exp(est_se[1] - 1.96*est_se[2])
upperRR  = exp(est_se[1] + 1.96*est_se[2])
evalue(est, lowerRR, upperRR)

## logistic regression -- obtain the conditional odds ratio
lead.logistic = glm(lead ~ ., family = binomial(link = "logit"),
                        data = lead[,-1])
est_se = summary(lead.logistic)$coef["smoking", c(1, 2)]

est      = OR(exp(est_se[1]), rare = FALSE)
lowerOR  = exp(est_se[1] - 1.96*est_se[2])
upperOR  = exp(est_se[1] + 1.96*est_se[2])
evalue(est, lowerOR, upperOR)

## linear regression
# standardizing conservatively by SD(Y)
ols = lm(age ~ income, data = lead)
est = OLS(ols$coefficients[2], sd = sd(lead$age))

# for a 1-unit increase in income 
evalue(est = est, 
       se = summary(ols)$coefficients['income', 'Std. Error'])

# for a 0.5-unit increase in income
evalue(est = est,
       se = summary(ols)$coefficients['income', 'Std. Error'],
       delta = 0.5)

# E-value for Cohen's d = 0.5 with SE = 0.25
evalue(est = MD(.5), se = .25)

# compute E-value for HR = 0.56 with CI: [0.46, 0.69]
# for a common outcome
evalue(HR(0.56, rare = FALSE), lo = 0.46, hi = 0.69)
# for a rare outcome
evalue(HR(0.56, rare = TRUE), lo = 0.46, hi = 0.69)

Example output

            point lower    upper
RR       0.800000  0.71 0.910000
E-values 1.809017    NA 1.428571
[1] 1.809017
[1] 1.809017
You are calculating a "non-null" E-value, i.e., an E-value for the
minimum amount of unmeasured confounding needed to move the estimate
and confidence interval to your specified true value rather than to the
null value.
[1] 2
     id smoking  lead age male edu.lt9 edu.9to11 edu.hischl edu.somecol
1 41493       1 FALSE  77    0       0         1          0           0
2 41502       1 FALSE  29    1       0         0          1           0
3 41512       1 FALSE  80    0       0         0          0           1
4 41545       1 FALSE  40    0       1         0          0           0
5 41556       1 FALSE  38    1       0         1          0           0
6 41558       1 FALSE  50    0       0         1          0           0
  edu.college edu.unknown income income.mis white black mexicanam otherhispan
1           0           0   1.57          0     1     0         0           0
2           0           0   3.41          0     0     0         1           0
3           0           0   1.24          0     1     0         0           0
4           0           0   1.27          0     0     0         1           0
5           0           0   1.24          0     1     0         0           0
6           0           0   1.22          0     0     1         0           0
  otherrace
1         0
2         0
3         0
4         0
5         0
6         0
Warning message:
glm.fit: algorithm did not converge 
            point    lower    upper
RR       2.488840 1.672007 3.704724
E-values 4.413804 2.732008       NA
Warning message:
glm.fit: algorithm did not converge 
            point    lower    upper
RR       1.642884 1.315436 2.051843
E-values 2.670591 1.959590       NA
Confidence interval crosses the true value, so its E-value is 1.
            point     lower   upper
RR       1.015465 0.9952602 1.03608
E-values 1.140780 1.0000000      NA
Confidence interval crosses the true value, so its E-value is 1.
            point     lower   upper
RR       1.007703 0.9976273 1.01788
E-values 1.095805 1.0000000      NA
            point    lower    upper
RR       1.576173 1.010050 2.459603
E-values 2.529142 1.110803       NA
            point    lower     upper
RR       0.670084 0.585935 0.7735267
E-values 2.349531       NA 1.9080039
            point lower    upper
RR       0.560000  0.46 0.690000
E-values 2.970223    NA 2.256198

EValue documentation built on Oct. 28, 2021, 9:10 a.m.