@@ -48,7 +48,7 @@ library(tidyverse)
48
48
49
49
df %>%
50
50
# w is optional
51
- summarise(smd = smd(z, x , w = wts))
51
+ summarise(smd = smd(confounder_1, exposure , w = wts)$estimate )
52
52
```
53
53
54
54
---
@@ -62,10 +62,10 @@ df %>%
62
62
smds <- df %>%
63
63
summarise(
64
64
across(
65
- z1, z2, z3 ,
65
+ c(confounder_1, confounder_2, ...) ,
66
66
list(
67
- unweighted = ~smd(.x, x )$estimate,
68
- weighted = ~smd(.x, x , wts)$estimate
67
+ unweighted = ~smd(.x, exposure )$estimate,
68
+ weighted = ~smd(.x, exposure , wts)$estimate
69
69
)
70
70
)
71
71
)
@@ -82,10 +82,10 @@ smds <- df %>%
82
82
smds <- df %>%
83
83
summarise( #<<
84
84
across( #<<
85
- z1, z2, z3 , #<<
85
+ c(confounder_1, confounder_2, ...) , #<<
86
86
list(
87
- unweighted = ~smd(.x, x )$estimate,
88
- weighted = ~smd(.x, x , wts)$estimate
87
+ unweighted = ~smd(.x, exposure )$estimate,
88
+ weighted = ~smd(.x, exposure , wts)$estimate
89
89
)
90
90
)
91
91
)
@@ -102,10 +102,10 @@ smds <- df %>%
102
102
smds <- df %>%
103
103
summarise(
104
104
across(
105
- z1, z2, z3 ,
105
+ c(confounder_1, confounder_2, ...) ,
106
106
list(
107
- unweighted = ~smd(.x, x )$estimate, #<<
108
- weighted = ~smd(.x, x , wts)$estimate #<<
107
+ unweighted = ~smd(.x, exposure )$estimate, #<<
108
+ weighted = ~smd(.x, exposure , wts)$estimate #<<
109
109
)
110
110
)
111
111
)
0 commit comments