\title{studies on the prevalence of depression after myocardial infarction}
\description{results from 19 studies assessing the prevalence of depression after myocardial infarction}
\bold{author}        \tab \code{character} \tab first author \cr
\bold{year}          \tab \code{integer}   \tab publication year \cr
\bold{region}        \tab \code{character} \tab country \cr
\bold{design}        \tab \code{character} \tab study design \cr
\bold{source}        \tab \code{character} \tab sample source \cr
\bold{age}           \tab \code{numeric}   \tab mean age \cr
\bold{males}         \tab \code{numeric}   \tab percentage of males \cr
\bold{first}         \tab \code{numeric}   \tab percentage of first-time mi \cr
\bold{questionnaire} \tab \code{character} \tab self-report questionnaire \cr
\bold{interview}     \tab \code{character} \tab structured interview \cr
\bold{timing}        \tab \code{character} \tab timing of depression assessment \cr
\bold{depr}          \tab \code{integer}   \tab subjects with depression \cr
\bold{n}             \tab \code{integer}   \tab sample size
this data set comes from a meta-analysis with 19 studies to estimate the prevalence of depression after a myocardial infarction. the variables \code{depr} and \code{n} contain the number of depressive patients and the total number of patients.
feng, l., li, l., liu, w., yang, j., wang, q., shi, l., & luo, m. (2019). prevalence of depression in myocardial infarction: a prisma-compliant meta-analysis. \emph{medicine}, \bold{98}(8), e14596. \verb{https://doi.org/10.1097/md.0000000000014596}
### conduct random effects meta-analysis
mp1 <- metaprop(depr, n, data = dat.feng2019,

\title{studies on radiation therapy with or without adjuvant chemotherapy in patients with malignant gliomas}
\description{results from 17 trials comparing post-operative radiation therapy with and without adjuvant chemotherapy in patients with malignant gliomas.}
\bold{nei}        \tab \code{numeric}    \tab sample size in the experimental group receiving radiotherapy plus adjuvant chemotherapy \cr
\bold{nci}        \tab \code{numeric}    \tab sample size in the control group receiving radiotherapy alone \cr
\bold{e1i}        \tab \code{numeric}    \tab number of survivors at 6 months in the experimental group \cr
\bold{c1i}        \tab \code{numeric}    \tab number of survivors at 6 months in the control group \cr
\bold{e2i}        \tab \code{numeric}    \tab number of survivors at 12 months in the experimental group \cr
\bold{c2i}        \tab \code{numeric}    \tab number of survivors at 12 months in the control group \cr
\bold{e3i}        \tab \code{numeric}    \tab number of survivors at 18 months in the experimental group \cr
\bold{c3i}        \tab \code{numeric}    \tab number of survivors at 18 months in the control group \cr
\bold{e4i}        \tab \code{numeric}    \tab number of survivors at 24 months in the experimental group \cr
\bold{c4i}        \tab \code{numeric}    \tab number of survivors at 24 months in the control group
the 17 trials report the post-operative survival of patients with malignant gliomas receiving either radiation therapy with adjuvant chemotherapy or radiation therapy alone. survival was assessed at 6, 12, 18, and 24 months in all but one study (which assessed survival only at 12 and at 24 months).
the data were reconstructed by trikalinos and olkin (2012) based on table 2 in fine et al. (1993) and table 3 in dear (1994). the data can be used to illustrate how a meta-analysis can be conducted of effect sizes reported at multiple time points using a multivariate model.
dear, k. b. g. (1994). iterative generalized least squares for meta-analysis of survival data at multiple times. \emph{biometrics}, \bold{50}(4), 989--1002. \verb{https://doi.org/10.2307/2533438}
trikalinos, t. a., & olkin, i. (2012). meta-analysis of effect sizes reported at multiple time points: a multivariate approach. \emph{clinical trials}, \bold{9}(5), 610--620. \verb{https://doi.org/10.1177/1740774512453218}
fine, h. a., dear, k. b., loeffler, j. s., black, p. m., & canellos, g. p. (1993). meta-analysis of radiation therapy with and without adjuvant chemotherapy for malignant gliomas in adults. \emph{cancer}, \bold{71}(8), 2585--2597. \verb{https://doi.org/10.1002/1097-0142(19930415)71:8<2585::aid-cncr2820710825>3.0.co;2-s}
### calculate log(ors) and sampling variances for each time point
dat <- escalc(measure="or", ai=e1i, n1i=nei, ci=c1i, n2i=nci, data=dat, var.names=c("y1i","v1i"))
dat <- escalc(measure="or", ai=e2i, n1i=nei, ci=c2i, n2i=nci, data=dat, var.names=c("y2i","v2i"))
dat <- escalc(measure="or", ai=e3i, n1i=nei, ci=c3i, n2i=nci, data=dat, var.names=c("y3i","v3i"))
dat <- escalc(measure="or", ai=e4i, n1i=nei, ci=c4i, n2i=nci, data=dat, var.names=c("y4i","v4i"))
### calculate the covariances (equations in appendix of trikalinos & olkin, 2012)
dat$v12i <- with(dat, nei / (e1i * (nei - e2i)) + nci / (c1i * (nci - c2i)))
dat$v13i <- with(dat, nei / (e1i * (nei - e3i)) + nci / (c1i * (nci - c3i)))
dat$v14i <- with(dat, nei / (e1i * (nei - e4i)) + nci / (c1i * (nci - c4i)))
dat$v23i <- with(dat, nei / (e2i * (nei - e3i)) + nci / (c2i * (nci - c3i)))
dat$v24i <- with(dat, nei / (e2i * (nei - e4i)) + nci / (c2i * (nci - c4i)))
dat$v34i <- with(dat, nei / (e3i * (nei - e4i)) + nci / (c3i * (nci - c4i)))
dat.long <- data.frame(study=rep(1:nrow(dat), each=4), time=1:4,
function(x) matrix(c( x$v1i, x$v12i, x$v13i, x$v14i,
x$v14i, x$v24i, x$v34i,  x$v4i), nrow=4, ncol=4, byrow=true))
### remove rows for the missing time points in study 17
### remove corresponding rows/columns from var-cov matrix
### replace any (near) singular var-cov matrices with ridge corrected versions
round(res$vectors \%*\% diag(res$values + 0.08) \%*\% t(res$vectors), 12)
### do not correct var-cov matrix of study 17
res <- rma.mv(yi, vc, mods = ~ 0 + factor(time), method="fe", data=dat.long)
### multivariate random-effects model with heteroscedastic ar(1) structure for the true effects
res <- rma.mv(yi, vc, mods = ~ 0 + factor(time), random = ~ time | study,
### profile the autocorrelation coefficient
medicine, oncology, odds ratios, longitudinal models