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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Clayton Springer <csprin at brandybuck.ca.sandia.gov> writes:> 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.library(MASS) data(iris3) (You need to install the VR bundle from CRAN first) -- O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Peter,> > 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. > > library(MASS) > data(iris3) > > (You need to install the VR bundle from CRAN first)I have already done this. (I have successfully worked through the example.) What I would like to do is use myown data and work through a similar exercise. --Clayton -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
> Date: Thu, 9 Mar 2000 08:52:40 -0800 > From: Clayton Springer <csprin at brandybuck.ca.sandia.gov> > To: Peter Dalgaard BSA <p.dalgaard at biostat.ku.dk>, r-help at stat.math.ethz.ch > > Peter, > > > > 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. > > > > library(MASS) > > data(iris3) > > > > (You need to install the VR bundle from CRAN first) > > I have already done this. (I have successfully worked through the example.) > What I would like to do is use myown data and work through a similar exercise. >Then look at the other examples (in MASS3), such as data(fgl) fgl.lda <- lda(type ~ ., fgl) fgl is a data frame, type is a factor. dcrabs.lda <- lda(crabs$sex ~ FL + RW + CL + CW, lcrabs) lcrabs is a data frame, crabs$sex is a factor. The general form is factor ~ var1 + var2 + ... + varn where vari had better be numerical variates. There are first looked for in the data frame supplied as the data argument, if any. -- 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 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._