[R] PROC DISCRIM vs. lda( ) in MASS
Greg Tarpinian
sasprog474 at yahoo.com
Tue Apr 17 15:58:46 CEST 2007
Hello,
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;
RUN;
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));
RUN;
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
understand that predict( ) or predict.lda( ) are the preferable
ways to obtain a classification prediction for new 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,
Greg
More information about the R-help
mailing list