Learn R Programming

binomTools (version 1.0-1)

profile: Profile likelihoods for parameters in binomial regression models

Description

Generate and plot the profile likelihoods for each parameter in a binomial regression model

Usage

## S3 method for class 'glm':
profile(fitted, which.par, alpha = 0.005, max.steps = 50,
         nsteps = 8, step.warn = 5, trace = F, ...)  

## S3 method for class 'profile.glm':
plot(x, which.par, likelihood = TRUE,
         log = FALSE, relative = TRUE, approx = TRUE, conf.int = TRUE,
         level = 0.95, n = 100, fig = TRUE, ylim = NULL, ...)

Arguments

fitted
An object of class glm with a binomial family
x
An object of class profile.glm
which.par
A numeric or character vector with the parameters to be profiled. If missing all parameters are profiled
alpha
The likelihood is profiled in approximately the 100*(1-alpha)% confidence region
likelihood
Logical for whether the profile likelihood or likelihood root should be plotted
log
Logical for whether the profile likelihood should be plotted on log-scale. Ignored if likelihood = FALSE
relative
Logical for whether the profile likelihood or log-likelihood should be plotted on a relative or absolute scale. Ignored if likelihood = FALSE
approx
Logical for whether a quadratic approximation should be included in the plot
conf.int
Logical for whether a confidence interval should be included in the plot
level
A scalar or numerical vector indicating the confindence level(s) to be included in the plot. Ignored if conf.int = FALSE
n
How many points to employ in the spline interpolation of the profile likelihood
fig
Logical for whether the profile likelihood should be plotted. If fig = FALSE the list of points from the spline interpolation is returned
ylim
The limits of the y-axis in the plot
trace
Logical for whether progress should be printed to the screen during the profiling process
nsteps
Number of profiling steps to take in each direction for each parameter. The number is approximate since the step size is determined according to a quadratic approximation to the profile log-likelihood, hence, the deviation of the value of n
max.steps
The maximum number of profiling steps in each direction for each parameter. A warning is issued if the number of max.steps is reached
step.warn
A warning is issued if the the actual number of steps in either direction does not exceed the number of step.warn
...
Additional arguments passed to other methods

Value

  • For profile: a list of class profile.glm with a range of parameter values and lroot statistics for each parameter in which.par For plot: if fig = FALSE a list with plotting points and confidence interval(s) for each parameter in which.par is returned. If fig = TRUE the list is returned invisibly.

Details

lroot returned by profile is the signed square-root of the usual profile likelihood $$sgn(\theta-\hat{\theta})\sqrt{2(l(\hat{\theta})-l(\theta))}$$ where $\theta$ is the parameter being profiled and $\hat{\theta}$ is the maximum likelihood estimate of $\theta$. The appertaining par.vals is a vector of $\theta$ values in an appropriate range around $\hat{\theta}$. The logical argument likelihood in plot controls if the profile likelihood or the likelihood root should be plotted.

References

Pawitan, Y. (2001). In All Likelihood: Statistical Modelling and Inference Using Likelihood. Oxford University Press.

See Also

glm, profile.glm, plot.profile

Examples

Run this code
data(serum)
serum.glm <- glm(cbind(y, n-y) ~ dose, family=binomial, data=serum)
pr <- profile(serum.glm)
plot(pr)

Run the code above in your browser using DataLab