Fit a mixed-effects meta-analysis model with inclusion of one or more spline terms
Source:R/splinemixmeta.R
splinemixmeta.RdFit a mixed-effects meta-analysis model with inclusion of one or more spline terms
Usage
splinemixmeta(
smooth = NULL,
formula,
se,
S = se^2,
manual_fixed = FALSE,
residual_re = TRUE,
data,
random = list(),
method = "reml",
bscov = "unstr",
...
)Arguments
- smooth
A smoothing term created by
mgcv::s(), or a list of such terms.- formula
A formula for the fixed effects part of the model.
- se
A vector of standard errors for the response variables.
- S
As an alternative to
se,Scan be provided in several formats to give variance-covariance information for the response variables.- manual_fixed
If
TRUE, the fixed-effect component (if any) of anysmoothterms is being manually included in theformulaand hence should not be obtained as the unpenalized component(s) ofsmooth. Normally the "fixed-effect component" is the linear component. Hence one should either providesmooth = s(x)withxomitted fromformula(e.g.formula = yorformula = y ~ 1) and thusmanual_fixed = FALSE, or providesmooth = s(x)withxincluded informula(e.g.formula = y ~ x) andmanual_fixed = TRUE. The model fits should be identical but the coefficient forxwill differ becausexwill be scaled differently if it was automatically obtained from the spline basis functions (i.e. withmanual_fixed = FALSE). In either case, the unpenalized dimensions of the smooth term and not include in the spline random effects.- residual_re
If
TRUE, a datum-level random effect for residual variation (beyond the measurement error specified byseorS) is automatically included (similar to the default behavior ofmixmeta::mixmeta()whenrandomis not specified). Normally this should beTRUEunless there is a clear reason to set itFALSE.- data
A data frame containing the variables in the model. If not provided, variables are sought from where the function was called.
- random
See
mixmeta::mixmeta(). This is a list of one-sided formulas specifying additional random effects beyond those that will be created from thesmoothargument andresidual_re.- method
This must be
reml. It is provided as an argument to make clear that onlyremlis supported for estimating models where spline formulations are set up as random effects. This simplifies catching cases where a user might try to pass a differentmethodvalue tomixmeta::mixmeta()via....- bscov
See
mixmeta::mixmeta(). This is relevant only ifrandomis provided.- ...
Additional arguments passed to
mixmeta::mixmeta().'
Value
An object of class splinemixmeta, unless there are no smooth terms, in which case an object of class mixmeta is returned.
Details
This function combines capabilities of mgcv and mixmeta in order to provide spline meta-regression, which means a meta-regression
model where the shape of the relationship is unspecified and estimated from the data with smoothing splines. Spline components built from
mgcv can be represented as random effects (along with fixed effects, which are unpenalized, typically for linear terms). mixmeta
supports fairly flexible specification of fixed and random effects in (univariate or multivariate) meta-analysis regression (meta-regression)
models. splinemixmeta takes mgcv-style specifications of smooth (spline) terms, sets them up for mixmeta, and the calls
mixmeta to fit the model by REML.
Only a limited set of s arguments and options are supported. Argument k should work. For bs, supported basis functions include "cr",
"cs", and "cc". Note that the default choice bs = "tp" does not work well and so results in a warning. (The supported basis functions are those
for which mgcv::smoothCon can produce diagonal penalty matrices are supported ("cr", "cs", "cc"), with the exception of "tp".
Arguments fx, m, by, id, and sp are not supported should not
be provided. Argument xt should work but is untested. Argument pc is untested.
Note that bs="cc" (cyclic cubic regression spline) does not have unpenalized components, so if this is used, manual_fixed is not relevant.
splinemixmeta is not particularly optimized for large data sets.
See also
predict.splinemixmeta()for predictions based on BLUPs (best linear unbiased predictors) from fittedsplinemixmetamodels. This is an S3 method that will be called frompredict(x)wherexis asplinemixmetaobject.plot.splinemixmeta()for plotting fitted spline meta-regression models. This is an S3 method that will be called fromplot(x)wherexis asplinemixmetaobject.blup.splinemixmeta()for obtaining BLUPs (best linear unbiased predictors) from fittedsplinemixmetamodels. This is used bypredict.splinemixmeta, which is typically easier to call directly. This is an S3 method that will be called fromblup(x)wherexis asplinemixmetaobject.make_smm_smooth()for the internal function that sets up spline terms for use insplinemixmeta.