---
title: "Fitting MNAR models in missingHE"
description: >
  This tutorial shows few examples of how models in missingHE can be fitted under different types of
  missing not at random (MNAR) assumptions for the outcome variables in trial-based CEA.
output: 
    bookdown::html_document2:
        base_format: rmarkdown::html_vignette
vignette: >
  %\VignetteIndexEntry{Fitting MNAR models in missingHE}
  %\VignetteEngine{knitr::rmarkdown}
  \usepackage[utf8]{inputenc}
---

```{r, echo = FALSE, message = FALSE}
knitr::opts_chunk$set(prompt = TRUE, highlight = F, background = '#FFFFFF',
                      collapse = T, comment = "#>")
library(missingHE)
library(bookdown)
library(ggplot2)

MenSS$trt <- factor(MenSS$trt)
levels(MenSS$trt) <- c("SoC", "MenSS")

options(width = 300)
set.seed(1014)
```

When analysing partially-observed data, any statistical method makes either explicit or implicit assumptions about the missing values which can never be verified from the data at hand. Typically, analyses rely on a *missing at random* (MAR) assumption, that is they assume that the observed data are able to fully explain missingness. However, there is always the chance that this assumption is not correct and that missingness also depends on some values which are not observed, leading to a *missing not at random* (MNAR) assumption. Thus, it is extremely important that the robustness of the results to a range of alternative missingness assumptions is assessed in sensitivity analysis, including MNAR.   

Each of the three types of missingness models implemented in `missingHE` through the functions `selection`, `pattern`, and `hurdle` can be fitted under MNAR for either or both the effectiveness and cost outcomes. In each model, MNAR assumptions are expressed in terms of some suitably-defined departures from a MAR assumption about the mean effectiveness and cost parameters. This tutorial illustrates how to specify a MNAR model in `missingHE` using the built-in data set called `MenSS`, which is directly available when installing and loading `missingHE` in your `R` workspace, as a toy example. See [Introduction to missingHE](Introduction_to_missingHE.Rmd) for an introductory tutorial of each type of missingness model in `missingHE` and a general presentation of the data from the `MenSS` data set. 

If you would like to have more information on the package, or would like to point out potential issues in the current version, feel free to contact the maintainer at <a.gabrio@maastrichtuniversity.nl>. Suggestions on how to improve the package are also very welcome. A development version of the package is also available from the author's main GitHub repository at <https://github.com/AnGabrio/missingHE>.

## Handling MNAR using selection models {#sec-sm}

Selection models encode MNAR assumptions by directly modelling the missingness mechanism, that is the model for the missing data indicator, as a function of some partially-observed variables. In `missingHE`, MNAR is specified by including the outcome variables ($e$ and/or $c$) inside the model formulae of the corresponding missing indicators (`model.me` and `model.mc`). For example, a model encoding a MNAR assumption for the missing effectiveness mechanism and a MAR assumption for the missing cost mechanism can be specified by setting

``` r
model.me <- me ~  e + ...
model.mc <- mc ~  1 + ...
```

where `me` and `mc` indicate the effectiveness and cost missingness indicator variables, while `...` is a suitable form for the combination of covariates to be used in each model. Inclusion of `e` into `model.me` instructs `missingHE` to include the partially-observed effectiveness variable into the logistic regression model for its missingness indicator. Since the regression coefficient capturing the dependence between missingness and the outcome ($\delta_e$) cannot be fully estimated from the observed data, its estimation implies some form of MNAR assumption for the missing effectiveness mechanism. In selection models, two sources of external information are used to identify these parameters: **informative prior distributions** and **distributional outcome assumptions**. 

  1. Informative priors on $\delta_e$ (or $\delta_c$ for costs) can be specified in the form of a `R` list object containing information about the desired prior specification, including name of the parametric distribution assumed (among a set of pre-defined choices) and its corresponding hyperparameter values. This list can then be passed to the `selection` function using the optional argument `prior` to overwrite the default priors (standard normals) assumed by `missingHE` for these parameters. 
  
  2. The distribution assumed for each outcome can be selected among a pre-defined set of parametric choices (selected among popular choices in the literature) using the arguments `dist_e` and `dist_c` inside the `selection` function. Type `help(selection)` to access the full list of available distributions for $e$ and $c$.

As an example, let us fit a MNAR selection model for the effectiveness variables (QALYs) available in the `MenSS` data set using the following command

```{r mnar-sel1-hide, echo=FALSE, eval=TRUE, message=FALSE, warning=FALSE, error=FALSE, results='hide'}
NN.sel1 = selection(data = MenSS, model.eff = e ~ trt + u.0, 
                    model.cost = c ~ trt, model.me = me ~ e, 
                    model.mc = mc ~ 1, type = "MNAR", 
                    n.iter = 1000, ref = 2, 
                    dist_e = "norm", dist_c = "norm")
```

```{r mnar-sel1, echo=TRUE, eval=FALSE, message=FALSE, warning=FALSE, error=FALSE, results='hide'}
NN.sel1 = selection(data = MenSS, model.eff = e ~ trt + u.0, 
                    model.cost = c ~ trt, model.me = me ~ e, 
                    model.mc = mc ~ 1, type = "MNAR", 
                    n.iter = 1000, ref = 2, 
                    dist_e = "norm", dist_c = "norm")
```

The MNAR assumption is encoded into the model by: setting the argument `type = "MNAR"`; adding the term `e` inside `model.me`. As for the outcome model, both effectiveness and costs are assumed to follow normal distributions, with the inclusion of the baseline utilities (`u.0`) as covariates into the model of $e$. Since we did not provide custom priors, default standard normals are specified for $\delta_e$. 

In general, `missingHE` allows a separate specification of assumptions for the effectiveness and cost missingness mechanisms through the arguments `model.me` and `model.mc`. When desired, other fully-observed variables can also be included into the missingness models (either under MAR or MNAR assumptions), to improve the estimation of the model paramters. Estimates of quantities of interest under the selected missingness assumptions can then be retrieved through the `print` function.

```{r print-sel1, echo=TRUE, eval=TRUE, message=FALSE, error=FALSE, error=FALSE}
print(NN.sel1)
```

We now consider an alternative MNAR specification where we encode informative priors on $\delta_e$. In general, it is difficult to attach a specific interpretation to the values for this parameter (and therefore also to its priors) because its effect may vary depending on the type of distributional assumptions made on the outcome. In this applied example we will therefore only illustrate how some already-defined suitable prior information can be passed into the model, rather than focussing on the plausibility of the chosen values within the current context.

We first define our priors by creating a list object called `my.prior`. Within this list, we create a vector of length three called `"delta.prior.e"` containing the following elements: name of the prior distribution (`"norm"`); the hyperprior values for the selected distribution (mean of $10$ and precision of $1$).

```{r prior-sel2, echo=TRUE, eval=TRUE, message=FALSE, error=FALSE, error=FALSE}
my.prior <- list(
  "delta.prior.e" = c("norm", 10, 1)
)
```

As a simple exercise, we increase the prior mean of $\delta_e$ to $10$ to assess the impact on posterior estimates of a quite informative prior about this parameter (relatively high positive value on the logit scale). We then fit the model using the new prior specification by passing the object `my.prior` to the argument `prior` inside `selection`.

```{r mnar-sel2-hide, echo=FALSE, eval=TRUE, message=FALSE, warning=FALSE, error=FALSE, results='hide'}
NN.sel2 = selection(data = MenSS, model.eff = e ~ trt + u.0, 
                    model.cost = c ~ trt, model.me = me ~ e, 
                    model.mc = mc ~ 1, type = "MNAR", 
                    n.iter = 1000, ref = 2, prior = my.prior,
                    dist_e = "norm", dist_c = "norm")
```

```{r mnar-sel2, echo=TRUE, eval=FALSE, message=FALSE, warning=FALSE, error=FALSE, results='hide'}
NN.sel2 = selection(data = MenSS, model.eff = e ~ trt + u.0, 
                    model.cost = c ~ trt, model.me = me ~ e, 
                    model.mc = mc ~ 1, type = "MNAR", 
                    n.iter = 1000, ref = 2, prior = my.prior,
                    dist_e = "norm", dist_c = "norm")
```

We can now check the results and compare them to those obtained under the initial MNAR model.

```{r print-sel2, echo=TRUE, eval=TRUE, message=FALSE, error=FALSE, error=FALSE}
print(NN.sel2)
```

We see that, with respect to the results from `NN.sel1`, the mean effectiveness estimates across both groups (`tmu_e`) are on average higher. Average mean estimates for each treatment group and associated incremental results for each model can also be inspected by using the `summary` function. To have a better idea of the impact in terms of cost-effectiveness conclusions, we can use the function `ceac.plot`, from the package `BCEA`, to display the cost-effectiveness acceptability curves based on the results from each model.

```{r figplotceamnarsel1, echo=FALSE, eval=TRUE, tidy=FALSE, error=FALSE, warning=FALSE, dpi=300, fig.show='hold',fig.cap="Cost-effectiveness acceptability curves (CEAC) derived from model 1 fitted under default MNAR prior specification for the missing effectiveness mechanism.",out.width='100%', fig.pos='h', out.extra=''}
ceac_sm1_mnar <- BCEA::ceac.plot(NN.sel1$cea, 
            graph = "ggplot2") + ggplot2::ggtitle("")
ceac_sm2_mnar <- BCEA::ceac.plot(NN.sel2$cea, 
            graph = "ggplot2") + ggplot2::ggtitle("")
ceac_sm1_mnar
```

```{r figplotceamnarsel2, echo=FALSE, eval=TRUE, tidy=FALSE, error=FALSE, warning=FALSE, dpi=300, fig.show='hold',fig.cap="Cost-effectiveness acceptability curves (CEAC) derived from model 2 fitted under custom MNAR prior specification for the missing effectiveness mechanism.",out.width='100%', fig.pos='h', out.extra=''}
ceac_sm2_mnar
```

The comparison between the graphs in Figure \@ref(fig:figplotceamnarsel1) and Figure \@ref(fig:figplotceamnarsel2) shows that CEA conclusions are somewhat affected by the specific assumptions made about the missingness mechanism, therefore suggesting that the results of the model are very robust to the MNAR assumptions considered. It is very important that the scenarios explored are informed based on some external information (e.g. expert opinion) to provide a range of *plausible* assumptions to assess in sensitivity analysis.

## Handling MNAR using pattern mixture models {#sec-pmm}

Pattern mixture models encode MNAR assumptions through the specification of two elements: **identifying restrictions** and **sensitivity parameters**. Identifying restrictions consist in modelling restrictions imposed to identify those parameters in each missingness pattern that cannot otherwise be identified from the data. In the context of a bivariate cross-sectional outcome ($e,c$), a total of four missingness patterns can be observed based on the combination of possible values taken by the outcome-specific missingness indicators $d^m=(m_i^c,m^e_i)$. These are: complete cases $(0,0)$; missing costs only $(1,0)$; missing effects only $(0,1)$; fully missing cases $(1,1)$. A typical example of these restrictions is when unidentifiable parameters in a given pattern (e.g. fully missing cases) are identified by matching those from a corresponding identifiable pattern (e.g. complete cases). Under MAR, these restrictions are the only element used to achieve the identification of the model. However, when MNAR assumptions are specified, identifying restrictions are often combined with additional parameters which are used to identify the model under a range of departures from MAR. These so-called "sensitivity parameters" are entirely identified using informative priors encoding evidence that is external to the observed data. Unlike the priors for the MNAR parameters in selection models, sensitivity parameters in pattern mixture models can have more intuitive and easier-to-assess interpretations in terms of their impact on posterior results. 

`missingHE` allows the specification of MNAR assumptions through the arguments `restriction` and `type` inside the function `pattern`. The first argument captures the type of identifying restrictions imposed: either complete case (`"CC"`) or available case (`"AC"`) restrictions. The second argument specifies the type of mechanism assumed for the missing values: either `MAR` or `MNAR`. Under MAR, the model is identified only based on the given identifying restrictions imposed at the location level in each unidentified pattern for both outcomes. For example, when `"CC"` restrictions are selected, the mean effectiveness and cost parameters in the fully missing cases $\mu_e^{(1,1)}$ and $\mu_c^{(1,1)}$ are set equal to those from the complete cases $\mu_e^{(0,0)}$ and $\mu_c^{(0,0)}$, respectively. Under MNAR, outcome-specific sensitivity parameters ($\delta_e$, $\delta_c$) are additively included within the chosen identification strategy. Using the same example, under MNAR, the mean outcomes in the fully missing cases are then identified as: 

\begin{equation}
\mu_e^{(1,1)}=\mu_e^{(0,0)}+\delta_e \;\;\; \text{and}  \;\;\; \mu_c^{(1,1)}=\mu_c^{(0,0)}+\delta_c,
 (\#eq:pmsp)
\end{equation}

where $\delta_e$ and $\delta_c$ are by default assigned with minimally informative uniform priors between $0$ ans $1$ by `missingHE` (both set to $0$ under MAR). Sensitivity analysis to alternative MNAR assumption scenarios about the mean outcomes can then be conducted by:

  1. Choosing alternative identifying restriction strategies to be passed to the argument `restriction`, i.e. either `"CC"` or `"AC"`.

  2. Specify informative priors on $\delta_e$ and/or $\delta_c$ in the form of a `R` list object containing information about the desired prior specification, including name of the parametric distribution assumed (among a set of pre-defined choices) and its corresponding hyperparameter values. This list can then be passed to the `pattern` function using the optional argument `prior` to overwrite the default priors (minimally informative uniforms) assumed by `missingHE` for these parameters under MNAR.  

Going back to our example, based on external information, assume that we expect the mean effectiveness among the missing cases to be on average between $0.2$ and $0.3$ lower compared to that among the observed cases across both treatment groups. This information can be encoded into a prior distribution for $\delta_e$ within a pattern mixture model in a similar way to what shown in Section \@ref(sec-sm) for selection models. The following code shows how to instruct `missingHE` to specify a uniform distribution (`"unif"`), with hyperprior boundary values of $0.2$ and $0.3$, for $\delta_e$.

```{r prior-pm2, echo=TRUE, eval=TRUE, message=FALSE, error=FALSE, error=FALSE}
my.prior <- list(
  "delta.prior.e" = c("unif", -0.3, -0.2)
)
```

Next, we proceed to fit the desired MNAR pattern mixture model using the function `pattern`, setting the arguments `restriction = "CC"`, `type = "MNAR"` and overwriting default prior specifications for $\delta_e$ with those contained in the object `my.prior`.  

```{r mnar-pat2-hide, echo=FALSE, eval=TRUE, message=FALSE, warning=FALSE, error=FALSE, results='hide'}
NN.pat2 = pattern(data = MenSS, model.eff = e ~ trt + u.0, 
                model.cost = c ~ trt, type = "MNAR", 
                restriction = "CC", n.iter = 1000, 
                ref = 2, prior = my.prior,
                dist_e = "norm", dist_c = "norm")
```

```{r mnar-pat2, echo=TRUE, eval=FALSE, message=FALSE, warning=FALSE, error=FALSE, results='hide'}
NN.pat2 = pattern(data = MenSS, model.eff = e ~ trt + u.0, 
                model.cost = c ~ trt, type = "MNAR", 
                restriction = "CC", n.iter = 1000, 
                ref = 2, prior = my.prior,
                dist_e = "norm", dist_c = "norm")
```

The function includes the baseline utilities in the model for $e$ and achieves identification under MNAR using complete case restrictions (`restriction = "CC"`) and informative priors on the sensitivity parameters for the mean $e$. Economic results in terms of posterior summaries about the mean parameters from the model can be seen using the `print` function

```{r print-pm2, echo=TRUE, eval=TRUE, message=FALSE, error=FALSE, error=FALSE}
print(NN.pat2)
```

For comparison, we also fit the same model under an alternative MNAR specification where we assume a normal distribution, roughly defined on the same value range, for the sensitivity parameters

```{r prior-pm3, echo=TRUE, eval=TRUE, message=FALSE, error=FALSE, error=FALSE}
my.prior2 <- list(
  "delta.prior.e" = c("norm", -0.25, 1/(0.05^2))
)
```

which is then passed to the argument `prior` in the `pattern` function

```{r mnar-pat3-hide, echo=FALSE, eval=TRUE, message=FALSE, warning=FALSE, error=FALSE, results='hide'}
NN.pat3 = pattern(data = MenSS, model.eff = e ~ trt + u.0, 
                model.cost = c ~ trt, type = "MNAR", 
                restriction = "CC", n.iter = 1000, 
                ref = 2, prior = my.prior2,
                dist_e = "norm", dist_c = "norm")
```

```{r mnar-pat3, echo=TRUE, eval=FALSE, message=FALSE, warning=FALSE, error=FALSE, results='hide'}
NN.pat3 = pattern(data = MenSS, model.eff = e ~ trt + u.0, 
                model.cost = c ~ trt, type = "MNAR", 
                restriction = "CC", n.iter = 1000, 
                ref = 2, prior = my.prior2,
                dist_e = "norm", dist_c = "norm")
```

We assess the impact on the cost-effectiveness results between the two MNAR specifications by looking at the acceptability curves derived from each model using again the function `ceac.plot` from the package `BCEA`.

```{r figplotceamnarpat1, echo=FALSE, eval=TRUE, tidy=FALSE, error=FALSE, warning=FALSE, dpi=300, fig.show='hold',fig.cap="Cost-effectiveness acceptability curves (CEAC) derived from model 1 fitted under uniform MNAR prior specification for the effectiveness sensitivity parameter.",out.width='100%', fig.pos='h', out.extra=''}
ceac_pm2_mnar <- BCEA::ceac.plot(NN.pat2$cea, 
            graph = "ggplot2") + ggplot2::ggtitle("")
ceac_pm3_mnar <- BCEA::ceac.plot(NN.pat3$cea, 
            graph = "ggplot2") + ggplot2::ggtitle("")
ceac_pm2_mnar
```

```{r figplotceamnarpat2, echo=FALSE, eval=TRUE, tidy=FALSE, error=FALSE, warning=FALSE, dpi=300, fig.show='hold',fig.cap="Cost-effectiveness acceptability curves (CEAC) derived from model 2 fitted under normal MNAR prior specification for the effectiveness sensitivity parameter.",out.width='100%', fig.pos='h', out.extra=''}
ceac_pm3_mnar
```

The graphs in Figure \@ref(fig:figplotceamnarpat1) and Figure \@ref(fig:figplotceamnarpat2) indicate a slightly lower chance for the new intervention to be cost-effective when comparing the results under an informative normal distribution for $\delta_e$ (`NN.pat3`) compared to when a uniform distribution is assumed (`NN.pat3`). Note that, in real applications, the range of values and choice of distribution for the sensitivity parameters should be informed based on some external source of information (e.g. expert opinion) to guide the elicitation process.

## Handling MNAR using hurdle models {#sec-hm}

Hurdle models consist of two-part mixture models, where the outcome variable (i.e. $e$, $c$ or both) are split into two components: one associated with identical values (called "structural") which are assumed to be fixed; and one associated with a set of values (called non-structural) which are assumed to be generated from a given distribution. `missingHE` models the non-structural outcome values using some parametric distributions and uses logistic regressions to estimate the probability of incurring in a structural value. In particular, the function `hurdle` requires the user to specify separate formulae for: the models estimating the mean outcome for the non-structural component through the usual arguments `model.eff` and `model.cost`; the logistic regressions estimating the structural value probabilities using the arguments `model.se` and `model.sc`:

``` r
model.se <- se ~  1 + ...
model.sc <- sc ~  1 + ...
```

where `se` and `sc` indicate the effectiveness and cost structural value indicator variables, while `...` is a suitable form for the combination of covariates to be used in each logistic regression model. Adopting a nomenclature similar to the one used for describing the missingness mechanism, it is possible to argue that exclusion of any covariates from these models corresponds to a "Structural Completely At Random" (SCAR) assumption, since the probability of a structural value does not depend on any observed variable. Similarly, inclusion of some covariates into these models suggests a "Structural At Random" (SAR) assumption, where the structural probability can only be correctly estimated conditional on some other observed variables. In contrast to selection or pattern mixture models, hurdle models do not provide an explicit framework for encoding informative missingness assumptions given that the missingness process is not directly modelled. However, they can be used to assess the impact of specific MNAR scenarios in terms of arbitrary assumptions about the number of missing individuals assigned to a structural value in the model. 

To illustrate how this is implemented in `missingHE`, let us first consider a standard hurdle model specification under MAR. We specify the model using `hurdle` to handle both structural ones and zeros in $e$ and $c$ from the `MenSS` data set, where values of one and zero are specified by setting the arguments `se = 1` and `sc = 0` inside `hurdle`, respectively. Since these values are assumed to be "fixed", their occurrence does not affect the choice of a distributional form for the non-structural component of the outcomes. As a result, we can assign distributions that are not defined at $1$ and $0$ to the non-structural outcome values, such as Beta and Gamma distributions for $e$ and $c$, respectively. 

```{r mar-hm1-hide, echo=FALSE, eval=TRUE, message=FALSE, warning=FALSE, error=FALSE, results='hide'}
NN.hur1 = hurdle(data = MenSS, model.eff = e ~ trt + u.0, 
                 model.cost = c ~ trt, model.se = se ~ 1, 
                 model.sc = sc ~ 1, type = "SCAR", 
                 se = 1, sc = 0, n.iter = 1000, ref = 2, 
                 dist_e = "beta", dist_c = "gamma")
```

```{r mar-hm1, echo=TRUE, eval=FALSE, message=FALSE, warning=FALSE, error=FALSE, results='hide'}
NN.hur1 = hurdle(data = MenSS, model.eff = e ~ trt + u.0, 
                 model.cost = c ~ trt, model.se = se ~ 1, 
                 model.sc = sc ~ 1, type = "SCAR", 
                 se = 1, sc = 0, n.iter = 1000, ref = 2, 
                 dist_e = "beta", dist_c = "gamma")
```

The model assumes that the mechanisms of the structural values in both outomes do not depend on any observed covariate, i.e. a *structural completely at random* (SCAR) mechanism. The function `hurdle` automatically assigns all individuals with an observed one effect and zero cost to the structural components of the effectiveness and cost mixture distributions, respectively. In general, we do not know to which component of the mixture the individuals with a missing value should be assigned, as this information cannot be obtained from the data. However, based on some external information that we may have, we arbitrarily impose this assignment (which effectively corresponds to a MNAR mechanism). 

In `missingHE`, this can be achieved by first creating an indicator variable (named `s_e`), telling for each individual whether a structural value is observed (`s_e = 1`), not observed (`s_e = 0`) or unknown (`s_e = NA`). For example, focussing on the effectiveness variables, we can obtain this indicator by typing

```{r d-mar-hm, echo=TRUE, eval=TRUE, message=FALSE, error=FALSE, error=FALSE}
s_e <- ifelse(MenSS$e == 1, 1, 0)

#number of ones
sum(s_e == 1, na.rm = T)
```

Next, for all or some of the individuals with a missing effect value, we set the value of `s_e = 1` to assign them to the structural component of the hurdle model. For example, we may believe that it is likely for all individuals aged $< 22$ to be associated with a perfect health status (i.e. $e = 1$). We can encode this information into a new object called `mys_e` by typing

```{r d-mnar-hm, echo=TRUE, eval=TRUE, message=FALSE, error=FALSE, error=FALSE}
mys_e <- ifelse(is.na(s_e) & MenSS$age < 22, 1, s_e)

#number of ones
sum(mys_e == 1, na.rm = T)
```

The number of individuals associated with $e = 1$ has considerably increased with respect to the observed data alone. We can now proceed to fit the hurdle model but replacing the original structural indicator variable of $e$ with the one newly created by setting the optional argument `s_e = mys_e`. 

```{r mnar-hm2-hide, echo=FALSE, eval=TRUE, message=FALSE, warning=FALSE, error=FALSE, results='hide'}
NN.hur2 = hurdle(data = MenSS, model.eff = e ~ trt + u.0, 
                 model.cost = c ~ trt, model.se = se ~ 1, 
                 model.sc = sc ~ 1, type = "SCAR", s_e = mys_e,
                 se = 1, sc = 0, n.iter = 1000, ref = 2, 
                 dist_e = "beta", dist_c = "gamma")
```

```{r mnar-hm2, echo=TRUE, eval=FALSE, message=FALSE, warning=FALSE, error=FALSE, results='hide'}
NN.hur2 = hurdle(data = MenSS, model.eff = e ~ trt + u.0, 
                 model.cost = c ~ trt, model.se = se ~ 1, 
                 model.sc = sc ~ 1, type = "SCAR", s_e = mys_e,
                 se = 1, sc = 0, n.iter = 1000, ref = 2, 
                 dist_e = "beta", dist_c = "gamma")
```

We can then inspect the posterior results by typing

```{r print-hm2, echo=TRUE, eval=TRUE, message=FALSE, error=FALSE, error=FALSE}
print(NN.hur2)
```

and we can look at how imputations in each treatment group are carried out based on the updated model using the generic `plot` function.

```{r figplothm2, echo=FALSE, eval=TRUE, tidy=FALSE, error=FALSE, warning=FALSE, dpi=300, fig.show='hold',fig.cap="Scatter plots of observed and imputed effectiveness data in the SoC (trt=1) arm based on an hurdle model assuming all individuals younger than 22 years old are associated with a perfect healf status.",out.width='100%', fig.pos='h', out.extra=''}
plot(NN.hur2, class = "scatter", outcome = "effects", trt = "SoC")
```

As Figure \@ref(fig:figplothm2) clearly shows, the model imputes missing effect values in `"SoC"` as one with very small credible intervals. Finally, we compare the economic results from the two alternative hurdle models using the `ceac.plot` function from the `BCEA` package.

```{r figplotceamnarhm1, echo=FALSE, eval=TRUE, tidy=FALSE, error=FALSE, warning=FALSE, dpi=300, fig.show='hold',fig.cap="Cost-effectiveness acceptability curves (CEAC) derived from the hurdle model fitted under a MAR assumption about the number of structural ones in SoC.",out.width='100%', fig.pos='h', out.extra=''}
ceac_hm1_mnar <- BCEA::ceac.plot(NN.hur1$cea, 
            graph = "ggplot2") + ggplot2::ggtitle("")
ceac_hm2_mnar <- BCEA::ceac.plot(NN.hur2$cea, 
            graph = "ggplot2") + ggplot2::ggtitle("")
ceac_hm1_mnar
```

```{r figplotceamnarhm2, echo=FALSE, eval=TRUE, tidy=FALSE, error=FALSE, warning=FALSE, dpi=300, fig.show='hold',fig.cap="Cost-effectiveness acceptability curves (CEAC) derived from the hurdle models fitted under a MNAR assumption about the number of structural ones in SoC.",out.width='100%', fig.pos='h', out.extra=''}
ceac_hm2_mnar
```

According to Figure \@ref(fig:figplotceamnarhm1) and Figure \@ref(fig:figplotceamnarhm2), the probability of cost-effectiveness for the hurdle model under MAR (`NN.hur1`) shows a moderate increase alongside the willingness to pay threshold up to $0.7$, where a plateau is observed. Conversely, results from the MNAR model (`NN.hur2`) indicate an higher chance of cost-effectiveness up to about $0.8$ for threshold values above $30000$. This is because the difference in the number of individuals assigned to a structural one between the treatments is more in favour of `"MenSS"` ($22$ vs $19$) under the specified MNAR assumptions compared with the number observed under MAR ($8$ vs $9$).

