[R] interaction terms formula error
Frank E Harrell Jr
f.harrell at vanderbilt.edu
Thu Jun 25 20:08:06 CEST 2009
Alejandra Solis Herrera wrote:
> Hi,
>
>
>
> I'm trying to fit a binary logistic regression model, and would like to consider certain characteristics B and C only for people with variable A=1 and not for those with variable A=0, so I'm trying to do the following:
>
>
>
> model<- lrm(formula= y ~ A: (B+C) + D + E +...)
>
>
>
> I've had no problem with adding interaction terms using " * ", but every time I try to use " : ", as in my example, I get an error message like:
>
The Design package doesn't support that. It uses the (highly
recommended) hierarchy principle so it assumes you will use * for
interactions.
Frank
>
>
> Error in if (!length(fname) || !any(fname == zname)) { :
>
> Missing value where TRUE/FALSE needed
>
>
>
> I would really appreciate any advice on how to solve this, I don't know what in the notation should be different for different operators.
>
>
>
> Thanks in advance, kind regards,
>
>
>
> Alejandra Solís
>
>
>
>
> [[alternative HTML version deleted]]
>
>
>
> ------------------------------------------------------------------------
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
--
Frank E Harrell Jr Professor and Chair School of Medicine
Department of Biostatistics Vanderbilt University
More information about the R-help
mailing list