Skip to content

Commit

Permalink
Make some code in vignette conditionnal
Browse files Browse the repository at this point in the history
  • Loading branch information
cedricbatailler committed Feb 27, 2024
1 parent 3ac3abd commit 427c32d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions vignettes/jsmediation.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -162,19 +162,19 @@ regard. This function uses a mediation model as a first argument, and the model
name (or model index) as a second argument. It then returns a linear model
object (i.e., an `lm` object).

```{r fig.height=8, fig.width=7, out.width="100%"}
```{r eval='rlang::is_installed("performance")', fig.height=8, fig.width=7, out.width="100%"}
first_model <- extract_model(mediation_fit, step = "X -> M")
performance::check_model(first_model)
```

We will do the same thing for the two other models mdt_simple has fitted.

```{r fig.height=8, fig.width=7, out.width="100%"}
```{r rlang::is_installed("performance"), fig.height=8, fig.width=7, out.width="100%"}
second_model <- extract_model(mediation_fit, step = 2)
performance::check_model(second_model)
```

```{r fig.height=8, fig.width=7, out.width="100%"}
```{r rlang::is_installed("performance"), fig.height=8, fig.width=7, out.width="100%"}
third_model <- extract_model(mediation_fit, step = 3)
performance::check_model(third_model)
```
Expand Down

0 comments on commit 427c32d

Please sign in to comment.