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

2005-12-07 Thread Andrew Robinson
To: 'Liaw, Andy'; 'Charles H. Franklin'; r-help@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

[R] Matrix of dummy variables from a factor

2005-12-06 Thread 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 -- Charles H. Franklin Professor, Political Science

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

2005-12-06 Thread Liaw, Andy
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.

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

2005-12-06 Thread John Fox
: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Charles H. Franklin Sent: Tuesday, December 06, 2005 3:03 PM To: r-help@stat.math.ethz.ch Subject: [R] Matrix of dummy variables from a factor What is a simple way to convert a factor into a matrix of dummy variables? fm-lm(y

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

2005-12-06 Thread Uwe Ligges
Charles H. Franklin wrote: What is a simple way to convert a factor into a matrix of dummy variables? fm-lm(y~f) model.matrix(y~f) Uwe Ligges 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.

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

2005-12-06 Thread Berton Gunter
, December 06, 2005 12:30 PM To: 'Charles H. Franklin'; r-help@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

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

2005-12-06 Thread Doran, Harold
. Franklin'; r-help@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

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

2005-12-06 Thread Ted Harding
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

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

2005-12-06 Thread roger koenker
On Dec 6, 2005, at 3:27 PM, 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

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

2005-12-06 Thread Charles H. Franklin
__ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

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

2005-12-06 Thread Hong Ooi
2000 +61 (2) 9292 1566 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Berton Gunter Sent: Wednesday, 7 December 2005 8:27 AM To: 'Liaw, Andy'; 'Charles H. Franklin'; r-help@stat.math.ethz.ch Subject: Re: [R] Matrix of dummy variables from a factor