Skip to content

Commit

Permalink
Fix error in vignette (#319)
Browse files Browse the repository at this point in the history
* Fix error in vignette

* fix

* fix scoping

* remove non working example

* fix

* fix

* fix

* fix

* fix
  • Loading branch information
strengejacke authored Feb 2, 2024
1 parent 5acfa64 commit deedc5f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
15 changes: 3 additions & 12 deletions vignettes/parameters.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ plot(result, show_intercept = TRUE)
## Model Parameters of Meta-Analysis models

```{r}
mydat <- data.frame(
mydat <<- data.frame(
effectsize = c(-0.393, 0.675, 0.282, -1.398),
standarderror = c(0.317, 0.317, 0.13, 0.36)
)
Expand Down Expand Up @@ -323,7 +323,8 @@ dat <- escalc(
)
dat$author <- make.unique(dat$author)
dat$disease <- sample(c("Cancer", "CVD", "Depression"), size = nrow(dat), replace = TRUE)
model <- rma(yi, vi, mods = ~disease, data = dat, digits = 3, slab = author)
mydat <<- dat
model <- rma(yi, vi, mods = ~disease, data = mydat, digits = 3, slab = author)
result <- model_parameters(model)
result
Expand Down Expand Up @@ -413,16 +414,6 @@ result
plot(result)
```

### From simulated model parameters

```{r fig.height=8}
simulated_parameters <- simulate_model(model1, component = "conditional")
result <- equivalence_test(simulated_parameters)
result
plot(result)
```

## p-value function and consonance/compatibility plot

_([related function documentation](https://easystats.github.io/parameters/reference/p_function.html))_
Expand Down
29 changes: 19 additions & 10 deletions vignettes/performance.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ plot(result)
Example where model **is** a good fit.

```{r}
model <- glm(am ~ mpg + vs + cyl, data = mtcars, family = "binomial")
model <- suppressWarnings(glm(am ~ mpg + vs + cyl, data = mtcars, family = "binomial"))
result <- binned_residuals(model)
result
Expand Down Expand Up @@ -150,26 +150,35 @@ plot(result, type = "bars")
_([related function documentation](https://easystats.github.io/performance/reference/check_normality.html))_

```{r}
model <- lm(mpg ~ wt + cyl + gear + disp, data = mtcars)
result <- check_normality(model)
model2 <- lm(mpg ~ wt + cyl + gear + disp, data = mtcars)
result2 <- check_normality(model2)
```

### Density Plot

```{r}
plot(result, type = "density")
```{r echo=FALSE}
plot(result2, type = "density", data = model2)
```
```{r eval=FALSE}
plot(result2, type = "density")
```

### QQ Plot

```{r}
plot(result, type = "qq")
```{r echo=FALSE}
plot(result2, type = "qq", data = model2)
```
```{r eval=FALSE}
plot(result2, type = "qq")
```

### PP Plot

```{r}
plot(result, type = "pp")
```{r echo=FALSE}
plot(result2, type = "pp", data = model2)
```
```{r eval=FALSE}
plot(result2, type = "pp")
```

## Check for Normal Distributed Random Effects
Expand Down Expand Up @@ -199,7 +208,7 @@ _([related function documentation](https://easystats.github.io/performance/refer
```{r}
model <- lm(len ~ supp + dose, data = ToothGrowth)
result <- check_homogeneity(model)
plot(result)
suppressWarnings(plot(result))
```

## Posterior Predictive Checks
Expand Down

0 comments on commit deedc5f

Please sign in to comment.