Re: [R] lrm -interaction without main effect-error message

From: Frank E Harrell Jr <>
Date: Tue, 01 Apr 2008 13:09:13 -0500

Eva Mosner wrote:
> Dear all,
> this might be not only an R-question but also a statistical.
> When I do a logistic regression analysis (species distribution modeling)
> with function lrm (Design package) I get the follwoing error message:
> > tadl1<-lrm(triad~fd+dista+fd2+dista2+fd:dista+dista:geo2, x=T, y=T)
> Error in if (!length(fname) || !any(fname == zname)) { :
> missing value where TRUE/FALSE needed
> The problem seems to be that geo2 (factor variable with 3 levels) is not
> included as main effect. But when I run the same model with glm it is
> working properly.
> However, from an ecological point of view, inclusion of only the
> interaction term makes sense. When running the model with inclusion of
> both main effect and interaction, main effect has no significant
> influence and the interaction only marginaly. And LR-Test underlines
> model simplification.
> Does anyone know how to solve the problem? I need the lrm function since
> I have to validate my models via bootstrapping (validate.lrm).
> Many thanks!
> Eva

No! The test of a 'main effect' that you did is not a valid test and it invalidates the hierarchy principle. Don't get lulled into thinking that parsimony is a good thing. Besides getting strange fits you will not preserve type I error or confidence interval coverage. If you were doing ols you would be getting an invalid estimate of sigma.

Model simplification is warranted if you tested an appropriate group of parameters with a test that has a large number of degrees of freedom. For example, you might argue that ALL interaction terms could be dropped if the P-value for the combined effects of all interaction parameters is 0.3. You might argue that one predictor could be dropped if the combined effects of all main effects and interaction effects containing the predictor gives a P-value of 0.25. Both of these tests also respect the hierarchy principle.


Frank E Harrell Jr   Professor and Chair           School of Medicine
                      Department of Biostatistics   Vanderbilt University

______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Received on Tue 01 Apr 2008 - 19:27:10 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 01 Apr 2008 - 19:30:25 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive