Re: [R] Matrix of dummy variables from a factor

From: Ted Harding <>
Date: Wed 07 Dec 2005 - 09:39:46 EST

On 06-Dec-05 Berton Gunter wrote:
> But note: There are (almost?) no situations in R where the dummy
> variables coding is needed. The coding is (almost?) always handled
> properly by the modeling functions themselves.
> Question: Can someone provide a "straightforward" example where the
> dummy variable coding **is** explicitly needed?

Perhaps not particularly straightforward, but if you are using package 'mix' for multiple imputation where some variables are categorical and some continuous, the functions



both take a paremeter "design" which is a design matrix expressing dependency of the continuous variables on the categoricals.

The R function 'model.matrix' is useful for obtaining this matrix.

Best wishes,

E-Mail: (Ted Harding) <> Fax-to-email: +44 (0)870 094 0861
Date: 06-Dec-05                                       Time: 22:39:44
------------------------------ XFMail ------------------------------

______________________________________________ mailing list PLEASE do read the posting guide! Received on Wed Dec 07 09:45:30 2005

This archive was generated by hypermail 2.1.8 : Wed 07 Dec 2005 - 14:28:03 EST