Skip to content
Back to formatted view

Raw Message

Message-ID: <20000308092542.D1459@brandybuck.ca.sandia.gov>
Date: 2000-03-08T17:25:42Z
From: Clayton Springer
Subject: Reading data for discriminant analysis

Dear R users,

I want to do discriminant analysis on my data. I have
successfully followed the discriminant analysis in V & R on
the iris data:

> ir <- rbind (iris3[,,1],iris3[,,2],iris3[,,3])
> ir.species <- c(rep("s",50),rep("c",50),rep("v",50))
> a <- lda(log(ir),ir.species)
> a$svd^2/sum(a$svd^2)
[1] 0.996498601 0.003501399
> a.x <- predict(a,log(ir),dimen=2)$x
> eqscplot (a.x,type="n",xlab="first linear discriminant", ylab = "second linear discriminant"
+ )
> text (a.x, ir.species)

I believe that the iris3 is rather special data format. 
But I am unable to get a text file to become something like iris3.
I would like to be able to formulate my data into a useable format. 
What is the proper procedure to create iris3 from external sources.

Thanks for your help,


Clayton Springer

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._