Skip to content

Commit

Permalink
update chapter imputation
Browse files Browse the repository at this point in the history
  • Loading branch information
tdebray123 committed Mar 11, 2024
1 parent 72bbb25 commit 5cbd311
Show file tree
Hide file tree
Showing 38 changed files with 8,047 additions and 197 deletions.
4 changes: 2 additions & 2 deletions _freeze/chapter_09/execute-results/html.json

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 31 additions & 1 deletion chapter_09.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ fplot <- plot_dis(data = data_hom) #Age density
fplot
```


We can calculate the treatment effect on the complete observed dataset. To do this, we start by balancing the dataset using Propensity Score matching. In this case, the propensity score model uses confounder variables only: `age`, `gender`, `prevDMTefficacy`, `logPremedicalcost`, and `prerelapseNum`.

```{r full1}
Expand Down Expand Up @@ -267,7 +268,7 @@ method["numSymptoms"] <- "pmm"
method["prevDMTefficacy"] <- "pmm"
# Generate 10 imputed datasets
imp <- mice(impdata, form = form_y, method = method, m = 10, maxit = 10,
imp <- mice(impdata, form = form_y, method = method, m = 100, maxit = 20,
printFlag = FALSE)
```

Expand All @@ -277,6 +278,16 @@ Before proceeding with the estimation procedure, we inspect the convergence of a
plot(imp)
```

We can also inspect these plots using **ggmice**:

```{r homimp convergency_ggmice}
#| message: false
#| warning: false
require(ggmice)
plot_trace(imp, c("age", "numSymptoms",
"logPremedicalcost", "prerelapseNum", "prevDMTefficacy"))
```

As there don't seem to be any problems in the trace plot (i.e., no marked tendency & well-dispersed plots), we can now proceed with the PS Matching in each of the imputed datasets using the **MatchedThem** package functions. Here, we adopt full matching without replacement and use a logistic model. The function allows the pooling of PS estimates, which can be done through the within or across approach.


Expand Down Expand Up @@ -404,6 +415,25 @@ ggpubr::ggarrange(Relapserate_plot0(data = data_hom),
common.legend = TRUE, legend = "bottom")
```

A summary of the complete data is given below

```{r}
#| echo: false
#| warning: false
df.tbl <- m_data_het %>% mutate(premedicalcost = exp(logPremedicalcost))
label(df.tbl$age) <- "Age"
units(df.tbl$age) <- "years"
label(df.tbl$gender) <- "Gender"
label(df.tbl$prerelapseNum) <- "Previous number of relapses"
label(df.tbl$prevDMTefficacy) <- "Efficacy of previous disease modifying therapy"
label(df.tbl$premedicalcost) <- "Previous medical cost (USD)"
units(df.tbl$premedicalcost) <- "\\$"
label(df.tbl$numSymptoms) <- "Previous number of symptoms"
table1(~ age + gender + prerelapseNum + prevDMTefficacy + premedicalcost + numSymptoms | treatment, data = df.tbl, caption = "Baseline characteristics of the case study data")
```

We use also the G computation to calculate the treatment effect, but this time in the main model, we take into account the interaction of the treatment and the covariates. In addition, we will estimate the conditional average treatment effect given the Iscore groups.
$$\tau_{CATE}(x) =E(y^1-y^0|X=x)$$

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 39 additions & 3 deletions docs/authors.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head>

<meta charset="utf-8">
<meta name="generator" content="quarto-1.3.433">
<meta name="generator" content="quarto-1.3.450">

<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">

Expand Down Expand Up @@ -253,33 +253,65 @@ <h1 class="title"><span class="chapter-number">11</span>&nbsp; <span class="chap
<td>Utrecht University, Utrecht, The Netherlands</td>
</tr>
<tr class="even">
<td>Christine Fletcher</td>
<td>GlaxoSmithKline, Stevenage, United Kingdom</td>
</tr>
<tr class="odd">
<td><a href="https://orcid.org/0000-0002-5263-3964">Elvira D’Andrea</a></td>
<td>AbbVie Inc., Boston, MA, United States</td>
</tr>
<tr class="odd">
<tr class="even">
<td><a href="https://orcid.org/0000-0001-5705-8615">Fabio Pellegrini</a></td>
<td>Biogen Spain, Madrid, Spain</td>
</tr>
<tr class="even">
<tr class="odd">
<td><a href="https://orcid.org/0000-0001-9310-6274">Gabrielle Simoneau</a></td>
<td>Biogen Canada, Toronto, Canada</td>
</tr>
<tr class="even">
<td><a href="https://orcid.org/0000-0001-9767-1924">Gerko Vink</a></td>
<td>Utrecht University, Utrecht, The Netherlands</td>
</tr>
<tr class="odd">
<td><a href="https://orcid.org/0000-0001-5536-8038">Grammati Sarri</a></td>
<td>Cytel Inc., London, United Kingdom</td>
</tr>
<tr class="even">
<td><a href="https://orcid.org/0000-0003-3276-2141">Hanne Oberman</a></td>
<td>Utrecht University, Utrecht, The Netherlands</td>
</tr>
<tr class="odd">
<td><a href="https://orcid.org/0000-0002-6154-8091">Jamie Elvidge</a></td>
<td>National Institute for Health and Care Excellence (NICE), Manchester, United Kingdom</td>
</tr>
<tr class="even">
<td><a href="https://orcid.org/0000-0001-5531-841X">Janie Coulombe</a></td>
<td>Université de Montréal, Montréal, Canada</td>
</tr>
<tr class="odd">
<td>Jeremy Dietz</td>
<td>National Institute for Health and Care Excellence (NICE), London, United Kingdom</td>
</tr>
<tr class="even">
<td><a href="https://orcid.org/0000-0003-2420-5716">Jessica L. Rohmann</a></td>
<td>Institute of Public Health, Charité, Universitätsmedizin Berlin, Berlin, Germany</td>
</tr>
<tr class="odd">
<td><a href="https://orcid.org/0000-0002-2384-5415">Johanna Muñoz</a></td>
<td>Julius Center for Health Sciences and Primary Care, University Medical Center Utrecht, Utrecht University, Utrecht, The Netherlands</td>
</tr>
<tr class="even">
<td><a href="https://orcid.org/0000-0001-7061-3767">Katrine Strandberg-Larsen</a></td>
<td>Department of Public Health, University of Copenhagen, Copenhagen, Denmark</td>
</tr>
<tr class="odd">
<td><a href="https://orcid.org/0000-0001-9718-021X">Konstantina Chalkou</a></td>
<td>Institute of Social and Preventive Medicine (ISPM), University of Bern, Bern, Switzerland</td>
</tr>
<tr class="even">
<td><a href="https://orcid.org/0000-0002-6479-4757">Marian Mitroiu</a></td>
<td>Biogen International GmbH, Baar, Zug, Switzerland</td>
</tr>
<tr class="odd">
<td><a href="https://orcid.org/0000-0002-0346-2871">Mohammad Ehsanul Karim</a></td>
<td>School of Population and Public Health, University of British Columbia, Vancouver, Canada</td>
Expand All @@ -288,6 +320,10 @@ <h1 class="title"><span class="chapter-number">11</span>&nbsp; <span class="chap
<td><a href="https://orcid.org/0000-0002-6887-5706">Tammy Jiang</a></td>
<td>Biogen, Cambridge, MA, United States</td>
</tr>
<tr class="odd">
<td><a href="https://orcid.org/0000-0001-6485-9947">Tat Thang Vo</a></td>
<td>The Wharton School, The University of Pennsylvania, Philadelphia, Pennsylvania, United States</td>
</tr>
</tbody>
</table>

Expand Down
Loading

0 comments on commit 5cbd311

Please sign in to comment.