mabb: Fit bivariate meta-analysis model to Beta-binomial parameters

View source: R/mabb.R

mabbR Documentation

Fit bivariate meta-analysis model to Beta-binomial parameters

Description

The Beta-binomial parameters and their asymptotic covariances are calculated from the observed means and standard deviations. Then a bivariate meta-analysis is perfomed. Several methods are available. See mvmeta.fit. For convenience, the mabb2 function is supplied which simplifies calling mabb if the columns of the supplied data.frame follow naming conventions.

Usage

mabb(N, size, obsmean, obssd, 
     X = model.matrix(~1, data.frame(N)), 
     method = "reml", bscov = "unstr",
     control = list(), logitrho = FALSE)
mabb2(data, N = "N", size = "size", 
      obsmean = "obsmean", obssd = "obssd", ...)     

Arguments

N

numeric. Vector of sample sizes. For mabb2: character. Name of column in data with sample sizes.

size

numeric. Vector of number of trials. For mabb2: character. Name of column in data with number of trials.

obsmean

numeric. Vector of observed means .For mabb2: character. Name of column in data with observed means.

obssd

numeric. Vector of observed standard deviations. For mabb2: character. Name of column in data with observed standard deviations.

X

model matrix. Assumes that an intercept is included in the model. See examples below for a convenient way to specify X for moderator analysis or meta-regression

method

Fitting method. Defaults to "reml". See mvmeta for other options.

bscov

a string defining the between-study (co)variance structure in likelihood based models. See mvmeta.fit.

control

list of parameters for controlling the fitting process. These are passed to mvmeta.fit to replace otherwise selected default values.

logitrho

logical. Should the parameter rho be logit-transformed? Defaults to FALSE, that is, the parameter rho is not transformed.

data

A data.frame with appropriate column names.

...

Arguments passed on from mabb2 to mabb.

Details

The mabb function calls bbm to calculate moment estimates from observed means and standard deviations. The workhorse function mvmeta.fit is then used to perform bivariate meta-analysis.

Meta-regression is supported via user supplied design matrices.

Value

An object of class c("maid") for which additional methods are available; see maid-Methods.

Author(s)

Philipp Doebler <philipp.doebler@googlemail.com>

References

Doebler, P. and Doebler, A. (submitted). Meta-analysis of individual differences based on sample means and standard deviations: An approach using the parameters of the Beta-binomial distribution.

Gasparrini A., Armstrong, B., Kenward M. G. (2012). Multivariate meta-analysis for non-linear and other multi-parameter associations. Statistics in Medicine. 31(29). 3821–3839.

See Also

maid-Methods,mvmeta, mvmeta.fit

Examples

# load example data set 
data(ICAR60)

#######################################################
# First example: intercept only model (no moderators) #
#######################################################
with(ICAR60, {
     fit1 <- mabb(N = N, size = test_length, 
                  obsmean = obsmean, obssd = obssd)
     summary(fit1)
}) # with() is used for convenience here (attach() is
   # an alternative)
   
# The same result can also be produced with
fit1 <- mabb(N = ICAR60$N, size = ICAR60$test_length, 
            obsmean = ICAR60$obsmean, obssd = ICAR60$obssd)
summary(fit1)

# the mabb2 function is a bit more convenient if
# the columns of the data frame match the
# argument names at least partially, and is yet
# another way to produce the above result:
fit1_2 <- mabb2(ICAR60, size = "test_length")
summary(fit1_2)

# It is also possible to use a fixed effects model (not 
# recommended) or moment estimation by using the method 
# argument (consult mvmeta and mvmeta.fit for more 
# information and additional estimators).

# Individual moment estimates and alpha KR21 estimates
# are extracted with the alphaKR21 method:
alphaKR21(fit1)
   
###########################################
# Second example: gradSample as moderator #
###########################################

# First step: create model matrix
X <- model.matrix( ~ gradSample, ICAR60)
  # note that the first argument of model.matrix is
  # a formula with no left hand side

# Second step: fit model
fit2 <- with(ICAR60, {
     mabb(N = N, size = test_length, 
                  obsmean = obsmean, obssd = obssd,
                  X = X)
})
summary(fit2)

# with mabb2, this can be achieved like this:
fit2_2 <- mabb2(ICAR60, size = "test_length", X = X)

# many standard methods are available, e.g.
AIC(fit2) # Akaike information criterion
coef(fit2) # fixed effect coefficients
# See maid-Methods for more information on methods.

###########################################
# Third example: sample size as moderator #
###########################################

# This is a toy example for a (more or less)
# continuous moderator.

# First step: create model matrix
X <- model.matrix( ~ N, ICAR60)
  # note that the first argument of model.matrix is
  # a formula with no left hand side

# Second step: fit model
with(ICAR60, {
     fit3 <- mabb(N = N, size = test_length, 
                  obsmean = obsmean, obssd = obssd,
                  X = X)
     summary(fit3)
     # no influence of sample size
})


maid documentation built on March 31, 2023, 3:07 p.m.