[R] Discriminant function analysis

tyler tyler.smith at mail.mcgill.ca
Thu Feb 7 16:16:15 CET 2008


On Thu, Feb 07, 2008 at 02:36:58PM +0000, Gavin Simpson wrote:
> 
> But I'm not sure this matters much. If you use the formula interface to
> lda(), factors get expanded to the dummy variables Tyler is talking
> about. But of course, a factor with two levels 0/1 doesn't need much
> manipulation as you only need a single dummy variable to represent its
> two states:
> 

Thanks, Gavin!

R's formula interface if very powerful, and I'm just starting to
understand how to take full advantage of it.

> You might want to standardise your exp variables to zero mean and unit
> variance prior to doing the lda so that all variables carry the same
> weight, if you have mixtures of numeric (continuous) variables and
> binary ones.

This is the part I was unsure of. If you have a categorical
explanatory variable with five levels, you can turn it into four dummy
variables, which you then standardize. Does the original variable end
up getting four times the weight of a single numerical variable?

Cheers,

Tyler

-- 
There is something fascinating about science. One gets such wholesale 
returns of conjecture out of such a trifling investment of fact.
                                       --Mark Twain



More information about the R-help mailing list