Skip to content

Commit e11b2dc

Browse files
make psuedo-variable namings consistent
1 parent f55bcbd commit e11b2dc

File tree

4 files changed

+62
-62
lines changed

4 files changed

+62
-62
lines changed
3.4 KB
Binary file not shown.

slides/raw/05-pscore-diagnostics.Rmd

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ library(tidyverse)
4848
4949
df %>%
5050
# w is optional
51-
summarise(smd = smd(z, x, w = wts))
51+
summarise(smd = smd(confounder_1, exposure, w = wts)$estimate)
5252
```
5353

5454
---
@@ -62,10 +62,10 @@ df %>%
6262
smds <- df %>%
6363
summarise(
6464
across(
65-
z1, z2, z3,
65+
c(confounder_1, confounder_2, ...),
6666
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
6969
)
7070
)
7171
)
@@ -82,10 +82,10 @@ smds <- df %>%
8282
smds <- df %>%
8383
summarise( #<<
8484
across( #<<
85-
z1, z2, z3, #<<
85+
c(confounder_1, confounder_2, ...), #<<
8686
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
8989
)
9090
)
9191
)
@@ -102,10 +102,10 @@ smds <- df %>%
102102
smds <- df %>%
103103
summarise(
104104
across(
105-
z1, z2, z3,
105+
c(confounder_1, confounder_2, ...),
106106
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 #<<
109109
)
110110
)
111111
)

0 commit comments

Comments
 (0)