# profile: Profile likelihoods for parameters in binomial regression... In binomTools: Performing diagnostics on binomial regression models

## Description

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

## Usage

 1 2 3 4 5 6 7 8 ## 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 nsteps to the actual number of steps performed is influenced by the degree of irregularity of the profile likelihood 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

## Details

lroot returned by profile is the signed square-root of the usual profile likelihood

sgn(θ-\hat{θ})√{2(l(\hat{θ})-l(θ))}

where θ is the parameter being profiled and \hat{θ} is the maximum likelihood estimate of θ. The appertaining par.vals is a vector of θ values in an appropriate range around \hat{θ}.

The logical argument likelihood in plot controls if the profile likelihood or the likelihood root should be plotted.

## 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.

## Note

The implementation of these functions are largely inspired by profile.glm from the MASS package and profile.clm from the ordinal package. This work is a direct extension of profile from MASS with an extended set of warnings. The main difference, though, is in the plotting functionality, which enables plot of the usual profile likelihood and log-likelihood and the optional inclusion of confidence interval(s).

Merete K Hansen

## References

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

glm, profile.glm, plot.profile
 1 2 3 4 data(serum) serum.glm <- glm(cbind(y, n-y) ~ dose, family=binomial, data=serum) pr <- profile(serum.glm) plot(pr)