plotLikelihoodFit | R Documentation |
Plot the likelihood approximation
plotLikelihoodFit(
approximation,
cyclopsFit,
parameter = "x",
logScale = TRUE,
xLabel = "Hazard Ratio",
limits = c(0.1, 10),
fileName = NULL
)
approximation |
An approximation of the likelihood function as fitted using the
|
cyclopsFit |
A model fitted using the |
parameter |
The parameter in the |
logScale |
Show the y-axis on the log scale? |
xLabel |
The title of the x-axis. |
limits |
The limits on the x-axis. |
fileName |
Name of the file where the plot should be saved, for example 'plot.png'. See the function ggplot2::ggsave in the ggplot2 package for supported file formats. |
Plots the (log) likelihood and the approximation of the likelihood. Allows for reviewing the approximation.
A Ggplot object. Use the ggplot2::ggsave function to save to file.
# Simulate a single database population:
population <- simulatePopulations(createSimulationSettings(nSites = 1))[[1]]
# Approximate the likelihood:
cyclopsData <- Cyclops::createCyclopsData(Surv(time, y) ~ x + strata(stratumId),
data = population,
modelType = "cox"
)
cyclopsFit <- Cyclops::fitCyclopsModel(cyclopsData)
approximation <- approximateLikelihood(cyclopsFit, parameter = "x", approximation = "custom")
plotLikelihoodFit(approximation, cyclopsFit, parameter = "x")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.