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 n indicates the amount of person-time within each exposure level. 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 cc, ir, and ci, for case-control, incidence-rate, and cumulative incidence data, respectively. data an optional data frame (or object coercible by as.data.frame to a data frame) containing the variables in the previous arguments. covariance method to approximate the coviariance among set of reported log relative risks, "gl" for the method proposed by Greenland and Longnecker (default), "h" for the method proposed by Hamling.

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.

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)))



[Package dosresmeta version 2.0.1 Index]