Skip to content

Commit

Permalink
update vignettes for CRAN submission
Browse files Browse the repository at this point in the history
  • Loading branch information
KZARCA committed Feb 18, 2021
1 parent ca14dd5 commit 89c446f
Show file tree
Hide file tree
Showing 14 changed files with 120 additions and 17 deletions.
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@
^data-raw$
^docs$
^_pkgdown\.yml$
^doc$
^Meta$
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
.Rhistory
.RData
README.html
doc
Meta
26 changes: 13 additions & 13 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Package: heemod
Title: Markov Models for Health Economic Evaluations
Version: 0.14.2
Version: 0.14.3
Authors@R: c(
person("Kevin", "Zarca", email = "[email protected]", role = c("aut", "cre")),
person("Antoine", "Filipovic-Pierucci", role = "aut"),
person("Matthew", "Wiener", role = "ctb"),
person("Zdenek", "Kabat", role = "ctb"),
person("Zden ek", "Kabat", role = "ctb"),
person("Vojtech", "Filipec", role = "ctb"),
person("Jordan", "Amdahl", role=c("ctb")),
person("Yonatan", "Carranza Alarcon", role=c("ctb")),
Expand All @@ -18,18 +18,18 @@ Description: An implementation of the modelling and reporting features described
32, 690-700 (2012).): deterministic and probabilistic sensitivity analysis,
heterogeneity analysis, time dependency on state-time and model-time
(semi-Markov and non-homogeneous Markov models), etc.
Depends: R (>= 3.3.0)
Depends: R (>= 3.6.0)
Imports:
dplyr (>= 0.7.2),
ggplot2 (>= 2.2.0),
lazyeval (>= 0.2.0),
memoise (>= 1.1.0),
mvnfast (>= 0.2.2),
plyr (>= 1.8.0),
pryr (>= 0.1.2),
tibble (>= 1.3.0),
rlang (>= 0.3),
purrr (>= 0.3)
dplyr (>= 1.0.4),
ggplot2 (>= 3.3.3),
lazyeval (>= 0.2.2),
memoise (>= 2.0.0),
mvnfast (>= 0.2.5),
plyr (>= 1.8.6),
pryr (>= 0.1.4),
tibble (>= 3.0.6),
rlang (>= 0.4.1),
purrr (>= 0.3.4)
License: GPL (>= 3)
LazyData: true
VignetteBuilder: knitr
Expand Down
13 changes: 12 additions & 1 deletion vignettes/a_introduction.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ output:
rmarkdown::html_vignette:
toc: true
vignette: >
%\VignetteIndexEntry{An Introduction to heemod}
%\VignetteIndexEntry{An Introduction to `heemod`}
%\VignetteEngine{knitr::rmarkdown}
\usepackage[utf8]{inputenc}
---
Expand All @@ -14,6 +14,17 @@ vignette: >
library(heemod)
```

```{r, echo = FALSE}
NOT_CRAN <- identical(tolower(Sys.getenv("NOT_CRAN")), "true")
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
purl = NOT_CRAN,
eval = NOT_CRAN,
screenshot.force = FALSE
)
```

This document is a presentation of the basic steps to define and run a model in `heemod`. Note that decision trees are actually a subset even of *Markov model*, and thus can be specified easily with this package.

When building a Markov model the following steps must be performed:
Expand Down
11 changes: 11 additions & 0 deletions vignettes/b_time_dependency.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,17 @@ vignette: >
library(heemod)
```

```{r, echo = FALSE}
NOT_CRAN <- identical(tolower(Sys.getenv("NOT_CRAN")), "true")
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
purl = NOT_CRAN,
eval = NOT_CRAN,
screenshot.force = FALSE
)
```

In more complex Markov models state values or transition probabilities can vary with time. These models are called *non-homogeneous* or *time-inhomogeneous* Markov models. A further distinction can be made depending on whether state values or transition probabilities:

1. depend on how long __the entire model__ has been running (model-time dependency);
Expand Down
7 changes: 7 additions & 0 deletions vignettes/c_homogeneous.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ library(heemod)
library(ggplot2)
```

```{r, echo = FALSE}
NOT_CRAN <- identical(tolower(Sys.getenv("NOT_CRAN")), "true")
knitr::opts_chunk$set(
screenshot.force = FALSE
)
```

The most simple Markov models in health economic evaluation are models were transition probabilities between states do not change with time. Those are called *homogeneous* or *time-homogeneous* Markov models.

## Model description
Expand Down
7 changes: 7 additions & 0 deletions vignettes/d_non_homogeneous.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ library(heemod)
library(ggplot2)
```

```{r, echo = FALSE}
NOT_CRAN <- identical(tolower(Sys.getenv("NOT_CRAN")), "true")
knitr::opts_chunk$set(
screenshot.force = FALSE
)
```

## Model description

This example is an implementation of the assessment of a new total hip replacement (THR) technology described in chapter 3.5 of [Decision Modelling for Health Economic Evaluation](https://global.oup.com/academic/product/decision-modelling-for-health-economic-evaluation-9780198526629). A more detailed report is available [at this location](https://www.york.ac.uk/media/che/documents/papers/technicalpapers/CHE%20Technical%20Paper%2028.pdf). This reports goes a bit further in the analysis. For the sake of simplicity we will not reproduce exactly the analysis from the book. See vignette `vignette("i-reproduction", "heemod")` for an exact reproduction.
Expand Down
10 changes: 10 additions & 0 deletions vignettes/e_probabilistic.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@ vignette: >
```{r, echo=FALSE, include=FALSE}
library(heemod)
```
```{r, echo = FALSE}
NOT_CRAN <- identical(tolower(Sys.getenv("NOT_CRAN")), "true")
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
purl = NOT_CRAN,
eval = NOT_CRAN,
screenshot.force = FALSE
)
```

This vignette shows how to transform the deterministic Markov model presented in `vignette("c-homogeneous", "heemod")` in a probabilistic model.

Expand Down
12 changes: 12 additions & 0 deletions vignettes/f_sensitivity.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,18 @@ vignette: >
\usepackage[utf8]{inputenc}
---

```{r, echo = FALSE}
NOT_CRAN <- identical(tolower(Sys.getenv("NOT_CRAN")), "true")
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
purl = NOT_CRAN,
eval = NOT_CRAN,
screenshot.force = FALSE
)
```


```{r, echo=FALSE, include=FALSE}
library(heemod)
Expand Down
10 changes: 9 additions & 1 deletion vignettes/g_heterogeneity.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ vignette: >
library(heemod)
```

```{r, echo = FALSE}
NOT_CRAN <- identical(tolower(Sys.getenv("NOT_CRAN")), "true")
knitr::opts_chunk$set(
screenshot.force = FALSE
)
```


```{r, include = FALSE}
param <- define_parameters(
Expand Down Expand Up @@ -223,7 +231,7 @@ plot(res_h, type = "counts")

Weights can be used in the analysis by including an optional column `.weights` in the new data to specify the respective weights of each strata in the target population.

```{r, eval=FALSE}
```{r}
tab_indiv_w
res_w <- update(res_mod, newdata = tab_indiv_w)
res_w
Expand Down
11 changes: 11 additions & 0 deletions vignettes/h_tabular.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@ vignette: >
\usepackage[utf8]{inputenc}
---

```{r, echo = FALSE}
NOT_CRAN <- identical(tolower(Sys.getenv("NOT_CRAN")), "true")
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
purl = NOT_CRAN,
eval = NOT_CRAN,
screenshot.force = FALSE
)
```

```{r, echo=FALSE, include=FALSE}
library(heemod)
library(dplyr)
Expand Down
11 changes: 11 additions & 0 deletions vignettes/i_reproduction.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@ vignette: >
\usepackage[utf8]{inputenc}
---

```{r, echo = FALSE}
NOT_CRAN <- identical(tolower(Sys.getenv("NOT_CRAN")), "true")
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
purl = NOT_CRAN,
eval = NOT_CRAN,
screenshot.force = FALSE
)
```

```{r, echo=FALSE, include=FALSE}
library(heemod)
```
Expand Down
11 changes: 11 additions & 0 deletions vignettes/j_survival.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,17 @@ vignette: >
library(heemod)
```

```{r, echo = FALSE}
NOT_CRAN <- identical(tolower(Sys.getenv("NOT_CRAN")), "true")
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
purl = NOT_CRAN,
eval = NOT_CRAN,
screenshot.force = FALSE
)
```

## Distributions

The `heemod` package provides a number of ways to estimate transition probabilities from survival distributions. Survival distributions can come from at least three different sources:
Expand Down
4 changes: 2 additions & 2 deletions vignettes/k_calibration.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ output:
rmarkdown::html_vignette:
toc: true
vignette: >
%\VignetteIndexEntry{Calibrating heemod models}
%\VignetteIndexEntry{Calibrating `heemod` models}
%\VignetteEngine{knitr::rmarkdown}
\usepackage[utf8]{inputenc}
---

```{r, echo=FALSE, include=FALSE}
library(heemod)
```

```{r, define, include = FALSE}
param <- define_parameters(
age_init = 60,
Expand Down

0 comments on commit 89c446f

Please sign in to comment.