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 grid with gradients distribution
#> rr lb ub logRr seLogRr
#> 1 0.6416258 0.03102474 3.774587 -0.44375 1.224834