Ein eingebundener Text mit undefiniertem Zeichensatz wurde abgetrennt. Name: nicht verf?gbar URL: https://stat.ethz.ch/pipermail/r-help/attachments/20070606/9059c7cc/attachment.pl
So what about asking your teacher (who seems to be Peter Filzmoser) and try to find out your homework yourself? You might want to think about some assumptions that must hold for LDA and look at the class of your explaining variables ... Uwe Ligges Soare Marcian-Alin wrote:> Hello, > > I want to make a linear discriminant analysis for the dataset olive, and I > get always this error:# > Warning message: > variables are collinear in: lda.default(x, grouping, ...) > > ## Loading Data > library(MASS) > olive <- url(" > http://www.statistik.tuwien.ac.at/public/filz/students/multi/ss07/olive.R") > print(load(olive)) > > y <- 1:572 > x <- sample(y) > y1 <- x[1:286] > > train <- olive[y1,-11] > test <- olive[-y1,-11] > > summary(train) > summary(test) > > table(train$Region) > table(test$Region) > > # Linear Discriminant Analysis > z <- lda(Region ~ . , train) > predict(z, train) > > z <- lda(Region ~ . , test) > predict(z, test) > > Thanks in advance! > > > > ------------------------------------------------------------------------ > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.
Ein eingebundener Text mit undefiniertem Zeichensatz wurde abgetrennt. Name: nicht verf?gbar URL: https://stat.ethz.ch/pipermail/r-help/attachments/20070606/b5069e42/attachment.pl
Region and Name are effectively the same variable cor(olive[,4:11]) will also show you that there are strong correlations between some of the variables - this is something you might want to avoid.... ________________________________ From: r-help-bounces at stat.math.ethz.ch on behalf of Soare Marcian-Alin Sent: Wed 06/06/2007 4:45 PM To: Uwe Ligges; R-help at stat.math.ethz.ch Subject: Re: [R] Linear Discriminant Analysis Thanks for explaining... Im just sitting at the homework for 6 hours after taking for one week antibiotica, because i had an amygdalitis... I just wanted some tipps for solving this homework, but thanks, I will try to get help on another way :) I think i solved it, but I still get this Error :( ## Loading Data library(MASS) olive <- url(" http://www.statistik.tuwien.ac.at/public/filz/students/multi/ss07/olive.R") print(load(olive)) dim(olive) summary(olive) index <- sample(nrow(olive), 286) train <- olive[index,-11] test <- olive[-index,-11] summary(train) summary(test) table(train$Region) table(test$Region) # Linear Discriminant Analysis z <- lda(Region ~ . , train) zn <- predict(z, newdata=test)$class mean(zn != test$Region) 2007/6/6, Uwe Ligges <ligges at statistik.uni-dortmund.de>:> > > So what about asking your teacher (who seems to be Peter Filzmoser) and > try to find out your homework yourself? > You might want to think about some assumptions that must hold for LDA > and look at the class of your explaining variables ... > > Uwe Ligges > > > > Soare Marcian-Alin wrote: > > Hello, > > > > I want to make a linear discriminant analysis for the dataset olive, and > I > > get always this error:# > > Warning message: > > variables are collinear in: lda.default(x, grouping, ...) > > > > ## Loading Data > > library(MASS) > > olive <- url(" > > > http://www.statistik.tuwien.ac.at/public/filz/students/multi/ss07/olive.R > ") > > print(load(olive)) > > > > y <- 1:572 > > x <- sample(y) > > y1 <- x[1:286] > > > > train <- olive[y1,-11] > > test <- olive[-y1,-11] > > > > summary(train) > > summary(test) > > > > table(train$Region) > > table(test$Region) > > > > # Linear Discriminant Analysis > > z <- lda(Region ~ . , train) > > predict(z, train) > > > > z <- lda(Region ~ . , test) > > predict(z, test) > > > > Thanks in advance! > > > > > > > > ------------------------------------------------------------------------ > > > > ______________________________________________ > > R-help at stat.math.ethz.ch mailing list > > https://stat.ethz.ch/mailman/listinfo/r-help > > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > > and provide commented, minimal, self-contained, reproducible code. >-- Mit freundlichen Gr?ssen / Best Regards Soare Marcian-Alin [[alternative HTML version deleted]]
Hi, when updating R I continuously face the problem that I have to reinstall packages or copy them into the new R library path. Is there a smart way of configuring R (.Rprofile) so the packages installed under older R versions (different lib paths) are included/found by newer R versions (e.g. R site archive). What problems due to version conflicts/out-of-date packages can arise? I am working with R on a Linux server. Thanks in advance, Will
Will wrote:> Hi, > > when updating R I continuously face the problem that I have to reinstall > packages or copy them into the new R library path. > > Is there a smart way of configuring R (.Rprofile) so the packages > installed under older R versions (different lib paths) are > included/found by newer R versions (e.g. R site archive). > What problems due to version conflicts/out-of-date packages can arise?See the manual R Installation and Administration on how to use library trees and how to update all packages for the recent version of R. If you do not recompile / update for a new major release of R, some packages (and packages that depend on them) may not work anymore (due to API changes, changes in S4 classes and so on). Uwe Ligges> I am working with R on a Linux server. > > Thanks in advance, > > Will > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.