covar.logrr {dosresmeta} | R Documentation |
Computes the covariance matrix for a set of log relative risks
Description
Reconstructs the covariance matrix for a set of (reported) log relative risks, given the number of cases and the number of total persons or person-years for each treatment (dose) level.
Usage
covar.logrr(cases, n, y, v, type, data, covariance = "gl")
Arguments
cases |
a vector, defining the number of cases for each exposure level. |
n |
a vector, defining the total number of subjects for each exposure level. For incidence-rate data |
y |
a vector, defining the (reported) log relative risks. |
v |
a vector, defining the variances of the reported log relative risks. |
type |
a vector (or a character string), specifying the design of the study. Options are
|
data |
an optional data frame (or object coercible by |
covariance |
method to approximate the coviariance among set of reported log relative risks, " |
Details
This is an internal function called by dosresmeta
to reconstruct the (co)variance matrix of the (adjusted) log relative risks. The function
calls, depending on the choosen method, grl
(default) or hamling
to reconstruct the effective counts corresponding to the (adjusted) log
relative risks as well as their standard errors. From these it computes the covariance matrix; analytical formulas can be found in the referenced article.
Value
The (co)variance matrix of the log relative risks.
Author(s)
Alessio Crippa, alessio.crippa@ki.se
References
Orsini, N., Li, R., Wolk, A., Khudyakov, P., Spiegelman, D. (2012). Meta-analysis for linear and nonlinear dose-response relations: examples, an evaluation of approximations, and software. American journal of epidemiology, 175(1), 66-73.
See Also
grl
, hamling
, covar.smd
, dosresmeta
Examples
## Loading data
data("alcohol_cvd")
## Obtaining the (co)variance matrix of log RR for the first study (id = 1)
covar.logrr(y = logrr, v = I(se^2), cases = cases, n = n, type = type,
data = subset(alcohol_cvd, id == 1))
## Obtaining the (co)variance matrices of log RRfor all study
by(alcohol_cvd, alcohol_cvd$id, function(x)
covar.logrr(y = logrr, v = I(se^2), cases = cases, n = n,
type = type, data = x))
## Restructuring the previous results in a list of matrices
do.call("list", by(alcohol_cvd, alcohol_cvd$id, function(x)
covar.logrr(y = logrr, v = I(se^2), cases = cases, n = n, type = type,
data = x)))