# clogistic: Conditional logistic regression In Epi: Statistical Analysis in Epidemiology

## Description

Estimates a logistic regression model by maximizing the conditional likelihood. The conditional likelihood calculations are exact, and scale efficiently to strata with large numbers of cases.

## Usage

 ```1 2 3``` ```clogistic(formula, strata, data, subset, na.action, init, model = TRUE, x = FALSE, y = TRUE, contrasts = NULL, iter.max=20, eps=1e-6, toler.chol = sqrt(.Machine\$double.eps)) ```

## Arguments

 `formula` Model formula `strata` Factor describing membership of strata for conditioning `data` data frame containing the variables in the formula and strata arguments `subset` subset of records to use `na.action` missing value handling `init` initial values `model` a logical value indicating whether model frame should be included as a component of the returned value `x,y` logical values indicating whether the response vector and model matrix used in the fitting process should be returned as components of the returned value. `contrasts` an optional list. See the `contrasts.arg` of `model.matrix.default` `iter.max` maximum number of iterations `eps` Convergence tolerance. Iteration continues until the relative change in the conditional log likelihood is less than `eps`. Must be positive. `toler.chol` Tolerance used for detection of a singularity during a Cholesky decomposition of the variance matrix. This is used to detect redundant predictor variables. Must be less than `eps`.

## Value

An object of class `"clogistic"`. This is a list containing the following components:

 `coefficients` the estimates of the log-odds ratio parameters. If the model is over-determined there will be missing values in the vector corresponding to the redundant columns in the model matrix. `var` the variance matrix of the coefficients. Rows and columns corresponding to any missing coefficients are set to zero. `loglik` a vector of length 2 containing the log-likelihood with the initial values and with the final values of the coefficients. `iter` number of iterations used. `n` number of observations used. Observations may be dropped either because they are missing, or because they belong to a homogeneous stratum. For more details on which observations were used, see `informative` below. `informative` if `model=TRUE`, a logical vector of length equal to the number of rows in the model frame. This indicates whether an observation is informative. Strata that are homogeneous with respect to either the outcome variable or the predictor variables are uninformative, in the sense that they can be removed without modifying the estimates or standard errors. If `model=FALSE`, this is NULL.

The output will also contain the following, for documentation see the `glm` object: `terms`, `formula`, `call`, `contrasts`, `xlevels`, and, optionally, `x`, `y`, and/or `frame`.

Martyn Plummer

`glm`

## Examples

 ```1 2``` ``` data(bdendo) clogistic(d ~ cest + dur, strata=set, data=bdendo) ```

### Example output

```Attaching package: 'Epi'

The following object is masked from 'package:base':

merge.data.frame

Call:
clogistic(formula = d ~ cest + dur, strata = set, data = bdendo)

coef exp(coef) se(coef)      z    p
cest.L  0.240     1.271    2.276  0.105 0.92
cest.Q  0.890     2.435    1.812  0.491 0.62
cest.C  0.113     1.120    0.891  0.127 0.90
dur.L   1.965     7.134    2.222  0.884 0.38
dur.Q  -0.716     0.489    1.858 -0.385 0.70
dur.C   0.136     1.146    1.168  0.117 0.91
dur^4      NA        NA    0.000     NA   NA

Likelihood ratio test=35.3  on 6 df, p=3.8e-06, n=254
```

Epi documentation built on Feb. 28, 2021, 1:06 a.m.