[R] PROC DISCRIM vs. lda( ) in MASS
Prof Brian Ripley
ripley at stats.ox.ac.uk
Tue Apr 17 16:33:58 CEST 2007
On Tue, 17 Apr 2007, Greg Tarpinian wrote:
> I am using WinXP, R version 2.3.1, and SAS for PC version 8.1.
> I have mostly used SAS over the last 4 years and would like to
> compare the output of PROC DISCRIM to that of lda( ) with respect
> to a very specific aspect. My data have k=3 populations and there
> are 3 variates in the feature space. When using using the code
> PROC DISCRIM DATA = FOO OUT = FOO_OUT OUTSTAT = FOOSTAT
> METHOD = NORMAL LIST POOL = YES PCOV MANOVA;
> CLASS STRATA;
> PRIORS EQUAL;
> VAR X1 X2 X3;
> I am able to easily obtain the linear discriminant functions for
> the strata which allow computation of the three discriminant
> scores for a given observation. This information is contained
> in WORK.FOOTSTAT and may be extracted by subsetting:
> DATA LDFUNC;
> SET FOOSTAT(WHERE = (_TYPE_ = LINEAR));
> To actually implement the linear discriminant functions takes
> a bit more formatting, but there it is.
> My question: Where is this information stored in R? I completely
Nowhere (R does not store things like SAS does). However, if you read the
help page you would see that the 'scaling' component of the result comes
There are lots of definitional questions about what is meant by
'the individual lin. discrim. functions': lda() is support software for a
book, and that explains its definitions.
> understand that predict( ) or predict.lda( ) are the preferable
> ways to obtain a classification prediction for new observations.
Or even the linear discriminants applied to new or old observations.
> I still want to "see" the individual lin. discrim. functions and
> work with them myself. I have been using
> x.lda <- lda(Strata ~ X1 + X2+ X3, data = foo.frame)
> to construct the analysis.
> Much thanks,
> R-help at stat.math.ethz.ch mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
Brian D. Ripley, ripley at stats.ox.ac.uk
Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel: +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UK Fax: +44 1865 272595
More information about the R-help