-----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.
save the result of expanding f into a matrix for later use.
Thanks.
Charles
--
Charles H. Franklin
Professor, Political Science
University of Wisconsin, Madison
franklin at polisci.wisc.edu
chfrankl at wisc.edu
608-263-2022 (voice)
608-265-2663 (fax)