Re: [R] how to convert multiple dummy variables to 1 factor variable?

2006-10-22 Thread Peter Dalgaard
Marc Schwartz [EMAIL PROTECTED] writes: On Sat, 2006-10-21 at 21:04 -0400, Wensui Liu wrote: Dear Listers, I am wondering how to convert multiple dummy variables to 1 factor variable. Thanks. wensui I was thinking of a function that is essentially the reverse of

Re: [R] how to convert multiple dummy variables to 1 factor variable?

2006-10-22 Thread Marc Schwartz
On Sun, 2006-10-22 at 09:35 +0200, Peter Dalgaard wrote: Marc Schwartz [EMAIL PROTECTED] writes: On Sat, 2006-10-21 at 21:04 -0400, Wensui Liu wrote: Dear Listers, I am wondering how to convert multiple dummy variables to 1 factor variable. Thanks. wensui I

Re: [R] how to convert multiple dummy variables to 1 factor variable?

2006-10-22 Thread Peter Dalgaard
Wensui Liu [EMAIL PROTECTED] writes: Thank you so much, Marc and Peter, Your method works great if I want to convert N dummies into N-level factor. But what if I want to convert N dummies into (N+1)-level factor? I tried both ways but none works. Mine should work, except for the colnames

Re: [R] how to convert multiple dummy variables to 1 factor variable?

2006-10-22 Thread Wensui Liu
Thank you so much, Marc and Peter, Your method works great if I want to convert N dummies into N-level factor. But what if I want to convert N dummies into (N+1)-level factor? I tried both ways but none works. Again, thank you so much! On 10/22/06, Marc Schwartz [EMAIL PROTECTED] wrote: On

Re: [R] how to convert multiple dummy variables to 1 factor variable?

2006-10-22 Thread Marc Schwartz
On Sun, 2006-10-22 at 14:03 -0500, Marc Schwartz wrote: On Sun, 2006-10-22 at 14:37 -0400, Wensui Liu wrote: Thank you so much, Marc and Peter, Your method works great if I want to convert N dummies into N-level factor. But what if I want to convert N dummies into (N+1)-level factor? I

Re: [R] how to convert multiple dummy variables to 1 factor variable?

2006-10-22 Thread Marc Schwartz
On Sun, 2006-10-22 at 14:37 -0400, Wensui Liu wrote: Thank you so much, Marc and Peter, Your method works great if I want to convert N dummies into N-level factor. But what if I want to convert N dummies into (N+1)-level factor? I tried both ways but none works. Again, thank you so much!

[R] how to convert multiple dummy variables to 1 factor variable?

2006-10-21 Thread Wensui Liu
Dear Listers, I am wondering how to convert multiple dummy variables to 1 factor variable. Thanks. wensui __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] how to convert multiple dummy variables to 1 factor variable?

2006-10-21 Thread Marc Schwartz
On Sat, 2006-10-21 at 21:04 -0400, Wensui Liu wrote: Dear Listers, I am wondering how to convert multiple dummy variables to 1 factor variable. Thanks. wensui I was thinking of a function that is essentially the reverse of model.matrix() which is used by R modeling functions. I did not