covar.smd {dosresmeta} | R Documentation |
Computes mean and standardized mean differences for continuous outcome with corresponding co(variance) matrix
Description
This internal function computes mean and standardized mean of a continuous outcome with the corresponding variances. It also reconstructs the covariance matrix from the available data.
Usage
covar.smd(y, sd, n, measure = "md", method = "cohens", data)
Arguments
y |
a vector defining the mean outcome for each treatment level. |
sd |
a vector defining the standard deviation of the outcome for each treatment level. |
n |
a vector defining the number of subjects for each treatment level. |
measure |
character string, indicating the measure to be calculated. Options are |
method |
character string indicating the method to be used. Options are |
data |
an optional data frame (or object coercible by |
Details
This is an internal function called by dosresmeta
to reconstruct the (co)variance matrix of the
outcome variable. The function is expected to be extended and/or modified at every release of the package
Value
A list containing the following
y | mean or standardized mean differences for each treatment level, included the referent one (0 by calculation). |
v | variances corresponding to the mean or standardized mean differences for each treatment level, included the referent one (0 by calculation) |
S | co(variance) matrix for the non-referent mean or standardized mean differences. |
Author(s)
Alessio Crippa, alessio.crippa@ki.se
References
Cooper, H., Hedges, L. V., & Valentine, J. C. (Eds.). (2009). The handbook of research synthesis and meta-analysis. Russell Sage Foundation.
See Also
Examples
## Loading the data
data("ari")
## Obtaining standardized mean differences, variances, and (co)varinace
## matrix for the first study (id = 1)
covar.smd(y, sd, n, measure = "smd", data = subset(ari, id == 1))
## Obtaining mean differences, variances, and (co)varinace matrices for the all the studies
cov.md <- by(ari, ari$id, function(x) covar.smd(y, sd, n, "md", data = x))
## Extracting mean differences
unlist(lapply(cov.md, function(x) x$y))
## Extracting variances for the mean differences
unlist(lapply(cov.md, function(x) x$v))
## List of the (co)variance matrices for the mean differences
lapply(cov.md, function(x) x$S)