Learn R Programming

EvidenceSynthesis (version 0.5.0)

approximateLikelihood: Approximate a likelihood function

Description

Approximate the likelihood function using a parametric (normal, skew-normal, or custom parametric), or grid approximation. The approximation does not reveal person-level information, and can therefore be shared among data sites. When counts are low, a normal approximation might not be appropriate.

Usage

approximateLikelihood(
  cyclopsFit,
  parameter = 1,
  approximation = "custom",
  bounds = c(log(0.1), log(10))
)

Value

A vector of parameters of the likelihood approximation.

Arguments

cyclopsFit

A model fitted using the Cyclops::fitCyclopsModel() function.

parameter

The parameter in the cyclopsFit object to profile.

approximation

The type of approximation. Valid options are 'normal', 'skew normal', 'custom', 'grid', or 'adaptive grid'.

bounds

The bounds on the effect size used to fit the approximation.

See Also

computeConfidenceInterval, computeFixedEffectMetaAnalysis, computeBayesianMetaAnalysis

Examples

Run this code
# Simulate some data for this example:
populations <- simulatePopulations()

cyclopsData <- Cyclops::createCyclopsData(Surv(time, y) ~ x + strata(stratumId),
  data = populations[[1]],
  modelType = "cox"
)
cyclopsFit <- Cyclops::fitCyclopsModel(cyclopsData)
approximation <- approximateLikelihood(cyclopsFit, "x")
approximation

# (Estimates in this example will vary due to the random simulation)

Run the code above in your browser using DataLab