On 2008-02-07, Birgit Lemcke <[EMAIL PROTECTED]> wrote: > > Am 06.02.2008 um 21:00 schrieb Tyler Smith: >> >>> My dataset contains variables of the classes factor and numeric. Is >>> there another function that is able to handle this? >> >> The numeric variables are fine. The factor variables may have to be >> recoded into dummy binary variables, I'm not sure if lda() will deal >> with them properly otherwise. > > But aren“t binary variables also factors? Or is there another > variable class than factor or numeric? > Do I have have to set the classe of the binaries as numeric? >
There is no binary class in R, so you would have to use a numeric field. For example: | sample | factor_1 | |--------+----------| | A | red | | B | green | | C | blue | becomes: | sample | dummy_1 | dummy_2 | |--------+---------+---------| | A | 1 | 0 | | B | 0 | 1 | | C | 0 | 0 | R can deal with dummy_1 and dummy_2 as numeric vectors. The details should be explained in a good reference on multivariate statistics (I'm looking at Legendre and Legendre (1998) section 1.5.7 and 11.5). HTH, Tyler ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.