plotProfiles: Plot profile likelihoods

View source: R/plot.R

plotProfilesR Documentation

Plot profile likelihoods

Description

Plot profile likelihoods

Usage

plotProfiles(fit, n = 100, showInitial = FALSE, maxiter = 50, tolerance = 0.1)

Arguments

fit

list, the fit object from multiRec. The fit object must be generated by calling multiRec with fitDetails=TRUE (the default is FALSE)

n

integer, the number of points on the profile likelihood plot

showInitial

logical, if TRUE the initial parameter estimates are shown on the figures as a hollow dot.

maxiter

integer, the number of iterations used to identify the x axis range on each figure.

tolerance

numeric, a multiplicative factor used the set the y axis range on each figure: the axis will range from approximately the maximum of the log likelihood to (1+tolerance) times the maximum

Details

The function generates a series of plots, one for each parameter in the model. Each plot shows the log likelihood on the vertical axis and a range of values for the parameter on the horizontal axis. The plot for a specific parameter is obtained by fixing the remaining parameters at their maximum likelihood value, and varying the plotted parameter over a range of values. The range of values is selected in such a way that the resulting likelihood ranges from 90

Plotting profile likelihoods is particularly important when using the identity link as it tends to have ill behaved likelihoods. When looking at profile plots, looks for multiple maxima, especially ones for which the corresponding likelihoods are similar in magnitude: if they exist, the interpretation of the fit returned by the model is questionable as there are other solutions that fit the data (almost) as well. Also look for discontinuities and sharp changes in slope (i.e discontinuities in the first derivatives) as these will often cause convergence problems.

Value

No return value; called for side effects (creates profile likelihood plots).

Examples

fit = multiRec(hf   ~ nPrior.afib(~male),
               afib ~ age + nPrior.afib() + nPrior.hf(),
               data=multiRecCVD2,
               idVar='id',
               link='log',
               fitDetails=TRUE)
plotProfiles(fit)


multiRec documentation built on Feb. 3, 2026, 5:06 p.m.