R: Add or Drop All Possible Single Terms to/from a 'logistf'...

add1.logistf {logistf} | R Documentation

## Add or Drop All Possible Single Terms to/from a `logistf` Model

### Description

Compute all the single terms in the scope argument that can be added to or dropped from the model, fit those models and compute a table of the changes in fit.

### Usage

    ## S3 method for class 'logistf'
    add1(object, scope, test = "PLR", ...)
    ## S3 method for class 'logistf'
    drop1(object, scope, test = "PLR", ...)

### Arguments

`object` | a fitted logistf object
`scope` | The scope of variables considered for adding or dropping. Should be a vector of variable names. Can be left missing; the method will then use all variables in the object's data slot which are not identified as the response variable.
`test` | The type of test statistic. Currently, only the PLR test (penalized likelihood ratio test) is allowed for logistf fits.
`...` | further arguments passed to or from other methods.

### Details

`drop1` and `add1` generate a table where for each variable the penalized likelihood ratio chi-squared, the degrees of freedom, and the p-value for dropping/adding this variable are given.

### Value

A matrix with `nvar` rows and 3 columns (Chisquared, degrees of freedom, p-value).

### Author(s)

Georg Heinze

### Examples

    data(sex2)
    fit<-logistf(data=sex2, case~1, pl=FALSE)
    add1(fit)

    fit2<-logistf(data=sex2, case~age+oc+dia+vic+vicl+vis)
    drop1(fit2)

[Package logistf version 1.23 Index]