# Analysis of penalized deviance for logistf models

### Description

This method compares hierarchical and non-hierarchical logistf models using penalized likelhood ratio tests. It replaces the function logistftest of former versions of logistf.

### Usage

1 2 |

### Arguments

`object` |
a fitted logistf model object |

`fit2` |
another fitted logistf model object, to be compared with |

`formula` |
alternatively to |

`method` |
One of |

`...` |
Further arguments passed to the method. |

### Details

Comparing models fitted by penalized methods, one must consider that the penalized likelihoods are not directly comparable, since a penalty is involved. Or in other words, inserting zero for some regression coefficients
will not lead to the same penalized likelihood as if the corresponding variables are simply "unknown" to a model. The `anova`

method takes care that the same penalty is used
for two hierarchically nested models, and if the models are not hierarchically nested, it will first relate each penalized likelihood to its null penalized likelihood, and only compare the resulting penalized likelihod ratio
statistics. The chi-squared approximation for this latter method (`PLR`

) is considered less accurate than that of the `nested`

method. Nevertheless, it is the only way to go for comparison of non-nested models.

### Value

An object of class `anova.logistf`

with items

`chisq` |
the chisquared statistic for the model comparison |

`df` |
the degrees of freedom |

`pval` |
the p-value |

`call` |
the function call |

`method` |
the method of comparison (input) |

`model1` |
the first model |

`model2` |
the second model which was compared to the first model |

`PLR1` |
the PLR statistic of the first model |

`PLR2` |
the PLR statistic of the second model; for the |

### Author(s)

Georg Heinze

### Examples

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ```
data(sex2)
fit<-logistf(data=sex2, case~age+oc+dia+vic+vicl+vis)
#simultaneous test of variables vic, vicl, vis:
anova(fit, formula=~vic+vicl+vis)
#test versus a simpler model
fit2<-logistf(data=sex2, case~age+oc+dia)
# or: fit2<-update(fit, case~age+oc+dia)
anova(fit,fit2)
# comparison of non-nested models (with different df):
fit3<-logistf(data=sex2, case~age+vic+vicl+vis)
anova(fit2,fit3, method="PLR")
``` |