covar.logrr {dosresmeta}  R Documentation 
Reconstructs the covariance matrix for a set of (reported) log relative risks, given the number of cases and the number of total persons or personyears for each treatment (dose) level.
covar.logrr(cases, n, y, v, type, data, covariance = "gl")
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 incidencerate 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, " 
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.
The (co)variance matrix of the log relative risks.
Alessio Crippa, alessio.crippa@ki.se
Orsini, N., Li, R., Wolk, A., Khudyakov, P., Spiegelman, D. (2012). Metaanalysis for linear and nonlinear doseresponse relations: examples, an evaluation of approximations, and software. American journal of epidemiology, 175(1), 6673.
grl
, hamling
, covar.smd
, dosresmeta
## 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)))