5
5
6
6
<!-- badges: start -->
7
7
8
- [ ![ R-CMD-check] ( https://github.com/LucyMcGowan /tipr/workflows/R-CMD-check/badge.svg )] ( https://github.com/LucyMcGowan /tipr/actions )
8
+ [ ![ R-CMD-check] ( https://github.com/r-causal /tipr/workflows/R-CMD-check/badge.svg )] ( https://github.com/r-causal /tipr/actions )
9
9
[ ![ DOI] ( https://joss.theoj.org/papers/10.21105/joss.04495/status.svg )] ( https://doi.org/10.21105/joss.04495 )
10
10
<!-- badges: end -->
11
11
12
12
** Authors:** [ Lucy D’Agostino
13
13
McGowan] ( https://www.lucymcgowan.com/ ) <br /> ** License:**
14
- [ MIT] ( https://opensource.org/licenses/MIT )
14
+ [ MIT] ( https://opensource.org/licenses/mit/ )
15
15
16
16
## Installation
17
17
@@ -96,18 +96,19 @@ between the unmeasured confounder and outcome needed to tip the analysis
96
96
tip(effect_observed = 1.5 , exposure_confounder_effect = 0.5 )
97
97
```
98
98
99
- ## The observed effect (1.5) WOULD be tipped by 1 unmeasured confounder
100
- ## with the following specifications:
101
- ## * estimated difference in scaled means between the unmeasured confounder
102
- ## in the exposed population and unexposed population: 0.5
103
- ## * estimated relationship between the unmeasured confounder and the outcome: 2.25
99
+ ## ℹ The observed effect (1.5) WOULD be tipped by 1 unmeasured confounder with the
100
+ ## following specifications:
101
+ ## • estimated difference in scaled means between the unmeasured confounder in the
102
+ ## exposed population and unexposed population: 0.5
103
+ ## • estimated relationship between the unmeasured confounder and the outcome:
104
+ ## 2.25
104
105
105
106
## # A tibble: 1 × 5
106
- ## effect_adjusted effect_observed exposure_confounder_effect confounde …¹ n_unm …²
107
- ## <dbl> <dbl> <dbl> <dbl> <dbl>
108
- ## 1 1 1.5 0.5 2.25 1
109
- ## # … with abbreviated variable names ¹confounder_outcome_effect,
110
- ## # ² n_unmeasured_confounders
107
+ ## effect_adjusted effect_observed exposure_confounder_e …¹ confounder_outcome_e …²
108
+ ## <dbl> <dbl> <dbl> <dbl>
109
+ ## 1 1 1.5 0.5 2.25
110
+ ## # ℹ abbreviated names: ¹exposure_confounder_effect, ²confounder_outcome_effect
111
+ ## # ℹ 1 more variable: n_unmeasured_confounders <dbl>
111
112
112
113
A hypothetical unobserved continuous confounder a scaled mean difference
113
114
between exposure groups of ` 0.5 ` would need a relationship of at least
@@ -117,18 +118,19 @@ between exposure groups of `0.5` would need a relationship of at least
117
118
tip(effect_observed = 1.09 , exposure_confounder_effect = 0.5 )
118
119
```
119
120
120
- ## The observed effect (1.09) WOULD be tipped by 1 unmeasured confounder
121
- ## with the following specifications:
122
- ## * estimated difference in scaled means between the unmeasured confounder
123
- ## in the exposed population and unexposed population: 0.5
124
- ## * estimated relationship between the unmeasured confounder and the outcome: 1.19
121
+ ## ℹ The observed effect (1.09) WOULD be tipped by 1 unmeasured confounder with
122
+ ## the following specifications:
123
+ ## • estimated difference in scaled means between the unmeasured confounder in the
124
+ ## exposed population and unexposed population: 0.5
125
+ ## • estimated relationship between the unmeasured confounder and the outcome:
126
+ ## 1.19
125
127
126
128
## # A tibble: 1 × 5
127
- ## effect_adjusted effect_observed exposure_confounder_effect confounde …¹ n_unm …²
128
- ## <dbl> <dbl> <dbl> <dbl> <dbl>
129
- ## 1 1 1.09 0.5 1.19 1
130
- ## # … with abbreviated variable names ¹confounder_outcome_effect,
131
- ## # ² n_unmeasured_confounders
129
+ ## effect_adjusted effect_observed exposure_confounder_e …¹ confounder_outcome_e …²
130
+ ## <dbl> <dbl> <dbl> <dbl>
131
+ ## 1 1 1.09 0.5 1.19
132
+ ## # ℹ abbreviated names: ¹exposure_confounder_effect, ²confounder_outcome_effect
133
+ ## # ℹ 1 more variable: n_unmeasured_confounders <dbl>
132
134
133
135
A hypothetical unobserved continuous confounder a scaled mean difference
134
136
between exposure groups of ` 0.5 ` would need a relationship of at least
@@ -171,13 +173,12 @@ mod_true |>
171
173
```
172
174
173
175
## # A tibble: 4 × 7
174
- ## term estimate std.error statistic p.value conf.low conf.…¹
175
- ## <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
176
- ## 1 (Intercept) 0.0245 0.163 -22.7 1.49e-114 0.0176 0.0334
177
- ## 2 exposure 0.921 0.172 -0.477 6.34e- 1 0.660 1.30
178
- ## 3 measured_confounder 2.44 0.0746 11.9 6.95e- 33 2.11 2.82
179
- ## 4 .unmeasured_confounder 2.42 0.0742 11.9 1.35e- 32 2.09 2.80
180
- ## # … with abbreviated variable name ¹conf.high
176
+ ## term estimate std.error statistic p.value conf.low conf.high
177
+ ## <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
178
+ ## 1 (Intercept) 0.0245 0.163 -22.7 1.49e-114 0.0176 0.0334
179
+ ## 2 exposure 0.921 0.172 -0.477 6.34e- 1 0.660 1.30
180
+ ## 3 measured_confounder 2.44 0.0746 11.9 6.95e- 33 2.11 2.82
181
+ ## 4 .unmeasured_confoun… 2.42 0.0742 11.9 1.35e- 32 2.09 2.80
181
182
182
183
Notice here the ` .unmeasured_confounder ` effect is 2.42 (which is
183
184
greater than the 2.25 we calculated that would be needed to render our
@@ -201,19 +202,22 @@ tip_with_binary(effect_observed = 1.09,
201
202
unexposed_confounder_prev = 0.10 )
202
203
```
203
204
204
- ## The observed effect (1.09) WOULD be tipped by 1 unmeasured confounder
205
- ## with the following specifications:
206
- ## * estimated prevalence of the unmeasured confounder in the exposed population: 0.25
207
- ## * estimated prevalence of the unmeasured confounder in the unexposed population: 0.1
208
- ## * estimated relationship between the unmeasured confounder and the outcome: 1.64
205
+ ## ℹ The observed effect (1.09) WOULD be tipped by 1 unmeasured confounder with
206
+ ## the following specifications:
207
+ ## • estimated prevalence of the unmeasured confounder in the exposed population:
208
+ ## 0.25
209
+ ## • estimated prevalence of the unmeasured confounder in the unexposed
210
+ ## population: 0.1
211
+ ## • estimated relationship between the unmeasured confounder and the outcome:
212
+ ## 1.64
209
213
210
214
## # A tibble: 1 × 6
211
- ## effect_adjusted effect_observed exposed_confounder_p…¹ unexp…² confo…³ n_unm…⁴
212
- ## <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
213
- ## 1 1 1.09 0.25 0.1 1.64 1
214
- ## # … with abbreviated variable names ¹exposed_confounder_prev,
215
- ## # ²unexposed_confounder_prev, ³ confounder_outcome_effect,
216
- ## # ⁴ n_unmeasured_confounders
215
+ ## effect_adjusted effect_observed exposed_confounder_prev unexposed_confounder…¹
216
+ ## <dbl> <dbl> <dbl> <dbl>
217
+ ## 1 1 1.09 0.25 0. 1
218
+ ## # ℹ abbreviated name: ¹unexposed_confounder_prev
219
+ ## # ℹ 2 more variables: confounder_outcome_effect <dbl> ,
220
+ ## # n_unmeasured_confounders <dbl>
217
221
218
222
A hypothetical unobserved binary confounder that is prevalent in 10% of
219
223
the unexposed population and 25% of the exposed population would need to
@@ -231,18 +235,19 @@ tip(effect_observed = 1.09,
231
235
confounder_outcome_effect = 1.05 )
232
236
```
233
237
234
- ## The observed effect (1.09) WOULD be tipped by 7 unmeasured confounders
235
- ## with the following specifications:
236
- ## * estimated difference in scaled means between the unmeasured confounder
237
- ## in the exposed population and unexposed population: 0.25
238
- ## * estimated relationship between the unmeasured confounder and the outcome: 1.05
238
+ ## ℹ The observed effect (1.09) WOULD be tipped by 7 unmeasured confounders with
239
+ ## the following specifications:
240
+ ## • estimated difference in scaled means between the unmeasured confounder in the
241
+ ## exposed population and unexposed population: 0.25
242
+ ## • estimated relationship between the unmeasured confounder and the outcome:
243
+ ## 1.05
239
244
240
245
## # A tibble: 1 × 5
241
- ## effect_adjusted effect_observed exposure_confounder_effect confounde …¹ n_unm …²
242
- ## <dbl> <dbl> <dbl> <dbl> <dbl>
243
- ## 1 1 1.09 0.25 1.05 7.07
244
- ## # … with abbreviated variable names ¹confounder_outcome_effect,
245
- ## # ² n_unmeasured_confounders
246
+ ## effect_adjusted effect_observed exposure_confounder_e …¹ confounder_outcome_e …²
247
+ ## <dbl> <dbl> <dbl> <dbl>
248
+ ## 1 1 1.09 0.25 1.05
249
+ ## # ℹ abbreviated names: ¹exposure_confounder_effect, ²confounder_outcome_effect
250
+ ## # ℹ 1 more variable: n_unmeasured_confounders <dbl>
246
251
247
252
It would take about ` 7 ` independent standardized Normal unmeasured
248
253
confounders with a mean difference between exposure groups of 0.25 and a
@@ -268,18 +273,18 @@ if (requireNamespace("broom", quietly = TRUE) && requireNamespace("dplyr", quie
268
273
}
269
274
```
270
275
271
- ## The observed effect (1.09) WOULD be tipped by 1 unmeasured confounder
272
- ## with the following specifications:
273
- ## * estimated difference in scaled means between the unmeasured confounder
274
- ## in the exposed population and unexposed population: 0.09
275
- ## * estimated relationship between the unmeasured confounder and the outcome: 2.5
276
+ ## ℹ The observed effect (1.09) WOULD be tipped by 1 unmeasured confounder with
277
+ ## the following specifications:
278
+ ## • estimated difference in scaled means between the unmeasured confounder in the
279
+ ## exposed population and unexposed population: 0.09
280
+ ## • estimated relationship between the unmeasured confounder and the outcome: 2.5
276
281
277
282
## # A tibble: 1 × 5
278
- ## effect_adjusted effect_observed exposure_confounder_effect confounde …¹ n_unm …²
279
- ## <dbl> <dbl> <dbl> <dbl> <dbl>
280
- ## 1 1 1.09 0.0907 2.5 1
281
- ## # … with abbreviated variable names ¹confounder_outcome_effect,
282
- ## # ² n_unmeasured_confounders
283
+ ## effect_adjusted effect_observed exposure_confounder_e …¹ confounder_outcome_e …²
284
+ ## <dbl> <dbl> <dbl> <dbl>
285
+ ## 1 1 1.09 0.0907 2.5
286
+ ## # ℹ abbreviated names: ¹exposure_confounder_effect, ²confounder_outcome_effect
287
+ ## # ℹ 1 more variable: n_unmeasured_confounders <dbl>
283
288
284
289
## Code of Conduct
285
290
0 commit comments