Re: [R] removing outlier --> use robust regression !

2015-09-15 Thread Martin Maechler
> Juli > on Sat, 12 Sep 2015 02:32:39 -0700 writes: > Hi Jim, thank you for your help. :) > My point is, that there are outlier and I don´t really > know how to deal with that. > I need the dataframe for a regression and read often that > only a few outlier

Re: [R] removing outlier

2015-09-13 Thread David Winsemius
If this mailing list accepted formatted submissions I would have used the trèsModernSarcastic font for my first sentence. Failing the availability of that mode of communication I am (top) posting through Nabble (perhaps) in "Comic Sans". On Sat, Sep 12, 2015 at 9:52 AM, David Winsemius

Re: [R] removing outlier

2015-09-13 Thread Bert Gunter
... and this, of course, is a nice example of how statistics contributes to the "irreproducibility crisis" now roiling Science. Cheers, Bert (Quote from a long ago engineering colleague: "Whenever I see an outlier, I never know whether to throw it away or patent it.") Bert Gunter "Data is not

Re: [R] removing outlier

2015-09-12 Thread David Winsemius
On Sep 12, 2015, at 2:32 AM, Juli wrote: > Hi Jim, > > thank you for your help. :) > > My point is, that there are outlier and I don´t really know how to deal with > that. > > I need the dataframe for a regression and read often that only a few outlier > can change your results very much. In

Re: [R] removing outlier

2015-09-12 Thread Juli
Hi Jim, thank you for your help. :) My point is, that there are outlier and I don´t really know how to deal with that. I need the dataframe for a regression and read often that only a few outlier can change your results very much. In addition, regression diacnostics didn´t indcate me the best

Re: [R] removing outlier

2015-09-11 Thread Jim Lemon
Hi Juli, What you can do is to make your outlier remover into a function like this: remove_outlier_by_sd<-function(x,nsd=3) { meanx<-mean(x,na.rm=TRUE) sdx<-sd(x,na.rm=TRUE) return(x[abs(x-xmean) < nsd*sdx]) } Then apply the function to your data frame ("table") newDA<-sapply(DA,remove_outlie

[R] removing outlier

2015-09-11 Thread Juli
Hey, i want to remove outliers so I tried do do this: # 1 define mean and sd sd.AT_ZU_SPAET <- sd(AT_ZU_SPAET) mitt.AT_ZU_SPAET <- mean(AT_ZU_SPAET) # sd.Anzahl_BAF <- sd(Anzahl_BAF) mitt.Anzahl_BAF <- mean(Anzahl_BAF) # sd.Änderungsintervall <- sd(Änderungsintervall) mitt.Änderungsintervall <-

Re: [R] removing outlier function / dataset update

2011-01-26 Thread kirtau
First off, thank you for the help with the global environment. I have however attempted to run the code and am now presented with a new error which is "Error in formula.default(eval(parse(text = x)[[1L]])) : invalid formula" and am not sure what to make of it. I have tried a few different work a

Re: [R] removing outlier function / dataset update

2011-01-26 Thread Ista Zahn
Hi, x and y are being picked up from your global environment, not from the x and y in dataset. Here is a version that seems to work: rm.outliers = function(dataset,var1, var2) { dataset$varpredicted = predict(lm(as.formula(paste(var1, var2, sep=" ~ ")), data=dataset)) dataset$varstdres =

[R] removing outlier function / dataset update

2011-01-26 Thread kirtau
Hi, I have a few lines of code that will remove outliers for a regression test based on the studentized residuals being above or below 3, -3. I have to do this multiple times and have attempted to create a function to lessen the amount of copying, pasting and replacing. I run into trouble with