R/LikelihoodApproximation.R
computeConfidenceInterval.Rd
Compute the point estimate and confidence interval given a likelihood function approximation
computeConfidenceInterval(approximation, alpha = 0.05)
An approximation of the likelihood function as fitted using the
approximateLikelihood()
function.
The alpha (expected type I error).
A data frame containing the point estimate, and upper and lower bound of the confidence interval.
Compute the point estimate and confidence interval given a likelihood function approximation.
# 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")
computeConfidenceInterval(approximation)
#> Detected data following custom parameric distribution
#> rr lb ub logRr seLogRr
#> 1 1.729533 0.2441386 7.93263 0.5478516 0.8880275