[R] help with panel.lda
Silvia Lomascolo
slomascolo at zoo.ufl.edu
Mon Jun 18 11:10:39 CEST 2007
I work with Windows, R version 2.4.1
I am trying to plot the results of a discriminant analysis done using the
lda function in the MASS library. The discriminant. analysis goes like this:
data.tb<-read.table('C:\\Documents and
Settings\\silvia\\Desktop\\dicrim_test.txt', header=T) ## the actual made-up
test matrix is pasted below
train<-sample (1:36, 15)
table (data.tb$group[train])
data.lda<-lda(group~., data.tb, subset = train)
predict (data.lda, data.tb[-train,])$class
Then I want to obtain a plot by writing:
>plot(data.lda, cex=0.7, 2, xlab='LD1', ylab='LD2')
but it's not working. It says that it could not find the function panel.
When I include panel=panel.lda, it tells me that the object 'panel.lda' was
not found. All I get is an empty plot in the graphics window. Was I
supposed to create an object called panel.lda? I cannot find in the help
what that object might be.
Any help would be appreciated.
TABLE USED:
group var1 var2 var3
1 1 3 55 6
2 1 4 66 7
3 1 5 55 8
4 1 4 66 7
5 1 3 44 6
6 1 3 55 5
7 1 3 44 4
8 1 4 44 3
9 1 4 44 7
10 1 4 66 6
11 2 5 88 9
12 2 4 99 8
13 2 8 88 9
14 2 9 76 8
15 2 8 66 9
16 2 9 99 10
17 2 10 100 9
18 2 4 99 9
19 2 8 88 8
20 2 9 76 9
21 2 8 66 10
22 2 9 99 9
23 3 2 11 11
24 3 3 22 2
25 3 1 33 3
26 3 1 11 1
27 3 2 44 2
28 3 3 22 3
29 3 4 11 1
30 3 1 11 1
31 3 2 22 2
32 3 3 33 3
33 3 1 11 1
34 3 1 44 2
35 3 2 22 3
36 3 3 11 1
--
View this message in context: http://www.nabble.com/help-with-panel.lda-tf3939027.html#a11172049
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list