You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: vignettes/comparison-with-other-packages.Rmd
+34-19Lines changed: 34 additions & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
title: "Comparison with other packages"
3
3
output: rmarkdown::html_vignette
4
4
vignette: >
5
-
%\VignetteEncoding{UTF-8}
5
+
%\VignetteEncoding{UTF-8}
6
6
%\VignetteEngine{knitr::rmarkdown}
7
7
editor_options:
8
8
chunk_output_type: console
@@ -11,28 +11,34 @@ vignette: >
11
11
12
12
```{r, include = FALSE}
13
13
knitr::opts_chunk$set(
14
-
collapse = TRUE,
15
-
comment = "#>"
14
+
collapse = TRUE,
15
+
comment = "#>"
16
16
)
17
17
```
18
18
19
19
```{r setup, warning=FALSE, message=FALSE}
20
20
library(outstandR)
21
21
```
22
22
23
-
There are already a few widely-used R packages in CRAN to perform model-based standardization, such as [`{marginaleffects}`](https://marginaleffects.com/) and [`{stdReg}/{StdReg2}`](https://sachsmc.github.io/stdReg2/).
23
+
The aim of this document is to compare the results from various other R packages with those produced using `{outstandR}`.
24
+
There are already a few widely-used R packages on CRAN to perform model-based standardization, such as [`{marginaleffects}`](https://marginaleffects.com/) and [`{stdReg}/{stdReg2}`](https://sachsmc.github.io/stdReg2/).
24
25
25
26
## marginaleffects
26
27
28
+
The `{marginaleffects}` package has functions to calculate G-computation estimates.
29
+
27
30
```{r , warning=FALSE, message=FALSE}
28
31
##TODO: see unit tests
29
32
library(marginaleffects)
33
+
34
+
# marginaleffects::avg_predictions()
35
+
# marginaleffects::avg_comparisons()
30
36
```
31
37
32
38
33
39
## stdReg[2]
34
40
35
-
`{StdReg}` has been rewritten to produce `{StdReg2}` which has "nicer output, more available methods, the possibility to include new methods, and mainly to make maintenance and updating easier." So, for this reason, we will use `{StdReg2}`.
41
+
The package `{stdReg}` has been rewritten to produce `{stdReg2}` which has "nicer output, more available methods, the possibility to include new methods, and mainly to make maintenance and updating easier." So, for this reason, we will use `{stdReg2}`.
36
42
37
43
We shall follow the article [_Estimation of causal effects using stdReg2_](https://sachsmc.github.io/stdReg2/articles/overview.html).
38
44
This is for continuous outcomes (change in weight) and includes transformed covariates.
@@ -82,13 +88,15 @@ nhefs.X <- nhefs_ipd %>%
82
88
list(mean = mean, sd = sd),
83
89
.names = "{fn}.{col}"))
84
90
85
-
nhefs.B <- dplyr::filter(nhefs_ipd, trt == 1) |>
91
+
nhefs.B <- nhefs_ipd |>
92
+
dplyr::filter(trt == 1) |>
86
93
summarise(y.B.sum = sum(y),
87
94
y.B.bar = mean(y),
88
95
y.B.sd = sd(y),
89
96
N.B = n())
90
97
91
-
nhefs.C <- dplyr::filter(nhefs_ipd, trt == 0) |>
98
+
nhefs.C <- nhefs_ipd |>
99
+
dplyr::filter(trt == 0) |>
92
100
summarise(y.C.sum = sum(y),
93
101
y.C.bar = mean(y),
94
102
y.C.sd = sd(y),
@@ -117,15 +125,15 @@ Alternatively, rather than dropping factors, we can create dummy variables to re
@@ -176,15 +184,15 @@ The 2024 [ISPOR poster by Hatswell](https://www.ispor.org/heor-resources/present
176
184
## maicplus
177
185
178
186
Roche developed the `maic` package which is now deprecated and replaced by `maicplus`.
179
-
We will follow the article titled [Anchored Binary Analysis](https://hta-pharma.github.io/maicplus/main/articles/anchored_binary.html) to make our comparison.
187
+
We will follow the article titled [Anchored Binary Analysis](https://hta-pharma.github.io/maicplus/main/articles/anchored_binary.html)which is part of their package to make our comparison.
0 commit comments