[R] fitting a logistic regression with mixed type of variables

David Winsemius dwinsemius at comcast.net
Mon Nov 16 20:32:53 CET 2009


On Nov 16, 2009, at 2:22 PM, Jack Luo wrote:

> Hi,
>
> I am trying to fit a logistic regression using glm, but my explanatory
> variables are of mixed type: some are numeric, some are ordinal,  
> some are
> categorical, say
>
> If x1 is numeric, x2 is ordinal, x3 is categorical, is the following  
> formula
> OK?

The formula's certainly "OK". What may be non-OK will be your  
understanding of the output. The default handling of ordinal factors  
is a common source of questions to R-help, so read up first.
>
> *model <- glm(y~x1+x2+x3, family=binomial(link="logit"),  
> na.action=na.pass)*

Why have you chosen that na.action option?

-- 
David Winsemius, MD
Heritage Laboratories
West Hartford, CT




More information about the R-help mailing list