From deedc5f4b06f8c65e5476f21ec071618fa9e563b Mon Sep 17 00:00:00 2001 From: Daniel Date: Fri, 2 Feb 2024 16:32:39 +0100 Subject: [PATCH] Fix error in vignette (#319) * Fix error in vignette * fix * fix scoping * remove non working example * fix * fix * fix * fix * fix --- vignettes/parameters.Rmd | 15 +++------------ vignettes/performance.Rmd | 29 +++++++++++++++++++---------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/vignettes/parameters.Rmd b/vignettes/parameters.Rmd index a65a39e38..a67424730 100644 --- a/vignettes/parameters.Rmd +++ b/vignettes/parameters.Rmd @@ -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) ) @@ -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 @@ -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))_ diff --git a/vignettes/performance.Rmd b/vignettes/performance.Rmd index 83ad11b29..1032e8182 100644 --- a/vignettes/performance.Rmd +++ b/vignettes/performance.Rmd @@ -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 @@ -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 @@ -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