Hong Ooi
Senior Research Analyst, IAG Limited
388 George St, Sydney NSW 2000
+61 (2) 9292 1566
-----Original Message-----
From: r-help-bounces at stat.math.ethz.ch
[mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Berton Gunter
Sent: Wednesday, 7 December 2005 8:27 AM
To: 'Liaw, Andy'; 'Charles H. Franklin'; r-help at stat.math.ethz.ch
Subject: Re: [R] Matrix of dummy variables from a factor
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?
-- Bert Gunter
Genentech Non-Clinical Statistics
South San Francisco, CA
"The business of the statistician is to catalyze the scientific learning
process." - George E. P. Box
> -----Original Message-----
> From: r-help-bounces at stat.math.ethz.ch
> [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Liaw, Andy
> Sent: Tuesday, December 06, 2005 12:30 PM
> To: 'Charles H. Franklin'; r-help at stat.math.ethz.ch
> Subject: Re: [R] Matrix of dummy variables from a factor
>
> See ?model.matrix.
>
> HTH,
> Andy
>
> From: Charles H. Franklin
> >
> > What is a simple way to convert a factor into a matrix of
> > dummy variables?
> >
> > fm<-lm(y~f)
> >
> > where f is a factor takes care of this in the estimation.
> I'd like to
> > save the result of expanding f into a matrix for later use.
> >
> > Thanks.
> >
> > Charles
> >
> > --
> >
_______________________________________________________________________________________
The information transmitted in this message and its attachme...{{dropped}}