Nothing
## ---- include = FALSE---------------------------------------------------------
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
## -----------------------------------------------------------------------------
library("metagam")
## -----------------------------------------------------------------------------
library("mgcv")
set.seed(1233)
shifts <- c(0, .5, 1, 0, -1)
datasets <- lapply(shifts, function(x) {
## Simulate data
dat <- gamSim(scale = .1, verbose = FALSE)
## Add a shift
dat$y <- dat$y + x * dat$x2^2
## Return data
dat
})
## -----------------------------------------------------------------------------
models <- lapply(datasets, function(dat){
b <- gam(y ~ s(x2, bs = "cr"), data = dat)
strip_rawdata(b)
})
## -----------------------------------------------------------------------------
meta_analysis <- metagam(models, type = "response")
## -----------------------------------------------------------------------------
plot(meta_analysis, legend = TRUE)
## -----------------------------------------------------------------------------
plot_heterogeneity(meta_analysis)
## -----------------------------------------------------------------------------
plot_heterogeneity(meta_analysis, type = "p")
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.