|
|
@@ -46,7 +46,7 @@ The function supports factors with more than 2 levels. |
|
|
```{r plot-1-2} |
|
|
plot_smooths( |
|
|
model = model, |
|
|
time_series = x2, |
|
|
series = x2, |
|
|
comparison = fac |
|
|
) + |
|
|
theme(legend.position = "top") |
|
|
@@ -65,7 +65,7 @@ model_2 <- gam( |
|
|
|
|
|
plot_smooths( |
|
|
model = model_2, |
|
|
time_series = x0 |
|
|
series = x0 |
|
|
) |
|
|
``` |
|
|
|
|
|
@@ -94,7 +94,7 @@ model_inter <- bam( |
|
|
```{r plot-interactions} |
|
|
plot_smooths( |
|
|
model = model_inter, |
|
|
time_series = Time, |
|
|
series = Time, |
|
|
comparison = Group, |
|
|
facet_terms = Condition, |
|
|
split = list(GroupCondition = c("Group", "Condition")) |
|
|
@@ -103,12 +103,12 @@ plot_smooths( |
|
|
``` |
|
|
|
|
|
To plot just one or some of the facets, you should use the `conditions` argument. |
|
|
This argument takes a list of quosures qith `quos()`. |
|
|
This argument takes a list of quosures with `quos()`. |
|
|
|
|
|
```{r plot-interactions-2} |
|
|
plot_smooths( |
|
|
model = model_inter, |
|
|
time_series = Time, |
|
|
series = Time, |
|
|
comparison = Group, |
|
|
facet_terms = Condition, |
|
|
conditions = quos(Condition == -1), |
|
|
@@ -120,7 +120,7 @@ plot_smooths( |
|
|
```{r plot-interactions-3} |
|
|
plot_smooths( |
|
|
model = model_inter, |
|
|
time_series = Time, |
|
|
series = Time, |
|
|
comparison = Group, |
|
|
facet_terms = Condition, |
|
|
conditions = quos(Condition %in% c(-1, 3)), |
|
|
@@ -132,12 +132,12 @@ plot_smooths( |
|
|
## Plotting the difference smooth |
|
|
|
|
|
The difference smooth can be plotted with `plot_difference()`. |
|
|
Portions of the difference smooth that do not inlcude 0 are shaded in red. |
|
|
Portions of the difference smooth that do not include 0 are shaded in red. |
|
|
|
|
|
```{r plot-diff-model} |
|
|
plot_difference( |
|
|
model, |
|
|
time_series = x2, |
|
|
series = x2, |
|
|
difference = list(fac = c("1", "2")) |
|
|
) |
|
|
``` |
|
|
|