Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Jan 31, 2025
1 parent 478415d commit adf6ea1
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
6 changes: 3 additions & 3 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -313,11 +313,11 @@ model <- mgcv::gam(Sepal.Width ~ s(Petal.Length), data = iris)
deriv <- estimate_slopes(model,
trend = "Petal.Length",
by = "Petal.Length",
length = 100
length = 200
)
# 2. Visualize predictions and derivative
plot(estimate_relation(model, length = 100)) /
plot(estimate_relation(model, length = 200)) /
plot(deriv) +
geom_hline(yintercept = 0, linetype = "dashed")
```
Expand Down Expand Up @@ -360,7 +360,7 @@ Also referred to as **Johnson-Neyman intervals**, this plot shows how the effect

For instance, the plot below shows that the effect of `hp` (the y-axis) is significantly negative only when `wt` is low (`< ~4`).

```{r eval=FALSE}
```{r}
model <- lm(mpg ~ hp * wt, data = mtcars)
slopes <- estimate_slopes(model, trend = "hp", by = "wt", length = 200)
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -429,11 +429,11 @@ model <- mgcv::gam(Sepal.Width ~ s(Petal.Length), data = iris)
deriv <- estimate_slopes(model,
trend = "Petal.Length",
by = "Petal.Length",
length = 100
length = 200
)

# 2. Visualize predictions and derivative
plot(estimate_relation(model, length = 100)) /
plot(estimate_relation(model, length = 200)) /
plot(deriv) +
geom_hline(yintercept = 0, linetype = "dashed")
```
Expand Down Expand Up @@ -501,6 +501,8 @@ slopes <- estimate_slopes(model, trend = "hp", by = "wt", length = 200)
plot(slopes)
```

<img src="man/figures/unnamed-chunk-13-1.png" width="100%" />

### Visualize predictions with random effects

Aside from plotting the coefficient of each random effect (as done
Expand Down
Binary file modified man/figures/unnamed-chunk-11-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added man/figures/unnamed-chunk-13-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/unnamed-chunk-3-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit adf6ea1

Please sign in to comment.