R/FixedEffectMetaAnalysis.R
computeFixedEffectMetaAnalysis.Rd
Compute a fixed-effect meta-analysis using a choice of various likelihood approximations.
computeFixedEffectMetaAnalysis(data, alpha = 0.05)
The meta-analytic estimate, expressed as the point estimate hazard ratio (rr), its 95 percent confidence interval (lb, ub), as well as the log of the point estimate (logRr), and the standard error (seLogRr).
# Simulate some data for this example:
populations <- simulatePopulations()
# Fit a Cox regression at each data site, and approximate likelihood function:
fitModelInDatabase <- function(population) {
cyclopsData <- Cyclops::createCyclopsData(Surv(time, y) ~ x + strata(stratumId),
data = population,
modelType = "cox"
)
cyclopsFit <- Cyclops::fitCyclopsModel(cyclopsData)
approximation <- approximateLikelihood(cyclopsFit, parameter = "x", approximation = "custom")
return(approximation)
}
approximations <- lapply(populations, fitModelInDatabase)
approximations <- do.call("rbind", approximations)
# At study coordinating center, perform meta-analysis using per-site approximations:
computeFixedEffectMetaAnalysis(approximations)
#> Detected data following custom parameric distribution
#> rr lb ub logRr seLogRr
#> 1 1.343546 0.5870484 2.792583 0.2953125 0.3978683
# (Estimates in this example will vary due to the random simulation)