Skip to content

Commit

Permalink
Lint vignette and aim to make reproducible
Browse files Browse the repository at this point in the history
  • Loading branch information
athowes committed Sep 2, 2024
1 parent fe2c2ed commit 145e5eb
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions vignettes/ebola.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ For users new to `epidist`, before reading this article, we recommend beginning
The packages used in this article are:

```{r load-requirements}
set.seed(1)
library(epidist)
library(data.table)
library(purrr)
Expand Down Expand Up @@ -164,9 +166,6 @@ Next, we use `observe_process()` to add interval censoring columns giving the lo

```{r}
obs_cens <- epidist::observe_process(sierra_leone_ebola_data)
# all(obs_cens$ptime == obs_cens$ptime_daily)
# all(obs_cens$stime == obs_cens$stime_daily)
```

Specially, the columns added by `observe_process` are:
Expand Down Expand Up @@ -220,7 +219,8 @@ fit <- epidist(
family = brms::lognormal(),
algorithm = "laplace",
refresh = 0,
silent = 2
silent = 2,
seed = 1
)
```

Expand All @@ -240,7 +240,8 @@ fit_sex <- epidist(
family = brms::lognormal(),
algorithm = "laplace",
refresh = 0,
silent = 2
silent = 2,
seed = 1
)
```

Expand All @@ -256,11 +257,15 @@ To do this, we will use district level random effects, assumed to be drawn from
```{r}
fit_sex_district <- epidist(
data = obs_prep,
formula = brms::bf(mu ~ 1 + sex + (1 | district), sigma ~ 1 + sex + (1 | district)),
formula = brms::bf(
mu ~ 1 + sex + (1 | district),
sigma ~ 1 + sex + (1 | district)
),
family = brms::lognormal(),
algorithm = "laplace",
refresh = 0,
silent = 2
silent = 2,
seed = 1
)
```

Expand Down Expand Up @@ -561,7 +566,8 @@ fit_sex_gamma <- epidist(
family = stats::Gamma(),
algorithm = "laplace",
refresh = 0,
silent = 2
silent = 2,
seed = 1
)
summary(fit_sex_gamma)
Expand Down

0 comments on commit 145e5eb

Please sign in to comment.