search for: stdres

Displaying 18 results from an estimated 18 matches for "stdres".

2011 Feb 09
5
Removing Outliers Function
...-3, respectively. The code below is what i have thus far for the function x = c(1:20) y = c(1,3,4,2,5,6,18,8,10,8,11,13,14,14,15,85,17,19,19,20) data1 = data.frame(x,y) rm.outliers = function(dataset,dependent,independent){ dataset$predicted = predict(lm(dependent~independent)) dataset$stdres = rstudent(lm(dependent~independent)) m = 1 for(i in 1:length(dataset$stdres)){ dataset$outlier_counter[i] = if(dataset$stdres[i] >= 3 | dataset$stdres[i] <= -3) {m} else{0} } j = length(which(dataset$outlier_counter >= 1)) while(j>=1){ print(dataset[whic...
2010 Nov 10
1
standardized/studentized residuals with loess
Hi all, I'm trying to apply loess regression to my data and then use the fitted model to get the *standardized/studentized residuals. I understood that for linear regression (lm) there are functions to do that:* * * fit1 = lm(y~x) stdres.fit1 = rstandard(fit1) studres.fit1 = rstudent(fit1) I was wondering if there is an equally simple way to get the standardized/studentized residuals for a loess model? BTW my apologies if there is something here that I'm missing. All the best, * * *Oliver * [[alternative HTML version delete...
2004 Jan 20
2
rstandard.glm() in base/R/lm.influence.R
...ut this first, because parts of the file are attributed to him. He says that he didn't write rstandard.glm(), and suggests asking r-devel. As it stands, rstandard.glm() has summary(model)$dispersion outside the sqrt(), while in rstandard.lm(), the sd is already sqrt()ed. This seems to follow stdres() in VR/MASS/R/stdres.R. Of course for the c("poisson", "binomial") families, summary(model)$dispersion is 1, so sqrt doesn't make a difference, but working with an epidemiologist, Marilia Carvalho, we wanted to map the standardised residuals of a quasipoisson null model...
2009 Feb 03
1
Time series plots with ggplot
Hi, I am newbie user of ggplot and would like some assistance in implementing time series plots. I'd like to know how the tsdiag plot can be made in ggplot? Thanks Harsh Singhal Decisions Systems, Mu Sigma Inc.
2013 Jun 10
1
padding specific missing values with NA to allow cbind
Dear list Getting very frustrated with this simple-looking problem > m1 <- lm(x~y, data=mydata) > outliers <- abs(stdres(m1))>2 > plot(x~y, data=mydata) I would like to plot a simple x,y scatter plot with labels giving custom information displayed for the outliers only, i.e. I would like to define a column mydata$labels for the mydata dataframe so that the command > text(mydata$y, mydata$x, labels=mydata$l...
2007 Mar 12
0
standardized residuals
I use nnet and want to calculate standardized residuals for training set I know there is a method of residuals for nnet. stdres doesn't work for nnet. Does anyone implement stdres for nnet? thanks, Aimin
2009 Dec 10
1
Detectar outliers en un gráfico de dispersión
Hola amigos, esta es mi primera duda, espero que no sea demasiado fácil. Tengo unos datos de dos variables y quiero mostrar recta de regresión y valor de correlación serie0 <- c(0.651, 0.712, 0.614, 0.645, 0.559, 0.647, 0.642, 0.534, 0.616, 0.621, 0.623) serie1 <- c(0.572, 0.641, 0.565, 0.596, 0.518, 0.604, 0.602, 0.501, 0.58, 0.589, 0.596) data <- cbind(serie0, serie1) colnames(data)
2010 Nov 17
1
how exactly does 'identify' work?
...the object 'x' ( the first argument ) is the thing that on the y axis. However, i have tried many many ways trying to get the LETTERS to be identified in the QQ-plot (plot(test.lm,2)) it never works..... I have even tried to extract the standardized residual using library(MASS), the 'stdres' function, and put it as the first argument in identify, still failed... Is there any means to achieve this? Thanks! casper -- View this message in context: http://r.789695.n4.nabble.com/how-exactly-does-identify-work-tp3045953p3045953.html Sent from the R help mailing list archive at Nabbl...
2009 Dec 10
0
Detectar outliers en un gráfico de dispersión SOLUCION
...quot;, cex=0.6) text(newx[length(newx)],prd[length(newx),2],"90%", cex=0.6) -- Gracias a todos 2009/12/10 Carlos J. Gil Bellosta <cgb en datanalytics.com>: > Hola, ¿qué tal? > > Si tu regresión es > > lm.00 <- lm(serie1 ~ serie0), > > entonces > > stdres( lm.00 ) > > es decir, los residuos estandarizados, "deberían" ser normales (de > hecho, haz plot( lm.00 ) ) con media 0 y varianza unitaria. > > Si escribes > > which( abs( stdres( lm.00 ) ) > mi.umbral  ) > > obtendrás los "outliers" dependiendo d...
2011 Mar 14
3
Standardized Pearson residuals
Is there any reason that rstandard.glm doesn't have a "pearson" option? And if not, can it be added? Background: I'm currently teaching an undergrad/grad-service course from Agresti's "Introduction to Categorical Data Analysis (2nd edn)" and deviance residuals are not used in the text. For now I'll just provide the students with a simple function to use, but I
2011 Mar 16
1
Standardized Pearson residuals (and score tests)
...;>> and deviance residuals are not used in the text. For now I'll just >>>> provide the students with a simple function to use, but I prefer to >>>> use R's native capabilities whenever possible. >>> >>> Incidentally, chisq.test will have a stdres component in 2.13.0 for >>> much the same reason. >> >> Thank you. That's one more thing I won't have to provide code for >> anymore. Coincidentally, Agresti mentioned this to me a week or two >> ago as something that he felt was missing, so that's...
2002 Sep 23
0
arima() in package ts.
...ut if I do flh <- arima(lh, order = c(3,0,0)) var(flh$residuals) I get 0.1824616, not (something close to) 1 as I would have expected. And flh$sigma2 is 0.1786603 --- which is pretty close to the foregoing value given by var(). Also I note that tsdiag.Arima creates rs <- object$resid stdres <- rs/sqrt(object$sigma2) i.e. it undertakes ``standardization''. So it looks to me as if the residuals component is NOT ``standardized''? Am I correct? (2) How is sigma2 calculated? The help says that it is the MLE of sigma-squared (the variance of the innovations). Can it...
2004 Apr 05
0
studentized deleted residuals and NA's
...e observation. I would think it should always produce NaN for this case. The following example illustrates this point. library(MASS) Data <- c(3,6,3,4,1,5,6,2) Group <- factor(c(1,1,2,3,3,4,5,5)) lm.out <- lm(Data ~ Group) data.frame(Data, Group, hat=lm.influence(lm.out)$hat, std.res=stdres(lm.out), stu.del.res=studres(lm.out)) OUTPUT: Data Group hat std.res stu.del.res 1 3 1 0.5 -8.9113279e-01 -8.4852814e-01 2 6 1 0.5 8.9113279e-01 8.4852814e-01 3 3 2 1.0 Inf NaN 4 4 3 0.5 8.9113279e-01 8.4852814e-01 5 1 3 0.5...
2005 Jan 18
0
standardised residuals using standard deviation
Dear R-users, I need to standardize residuals using standard deviation. Is the 'stdres' the proper function? Beside other methods (for standardization and normalization), are there some approaches how to standardize using standard deviation? Here is the sample of my residuals: Zres040 Zres0820 Sres040 Sres0820 PCres040 -2.101740 -2.0682900 1.6328500 0....
2003 Jun 26
1
Residual plotting
Dear all, So far i could do (in an informal way) to draw a Standardized Resisual plot in the following way- --------------------- >x <- c(104.1, 106.6, 105.5, 107.5, 109.6, 113.3, 115.5, 117.7, 119.9, 122.1, 124.3, 126.5, 128.2) >y <- c(53732, 52912, 57005, 61354, 67682, 71602, 71961, 75309, 82931, 93310, 102161, 103068, 108927) >
2012 May 04
2
Binomial GLM, chisq.test, or?
...1 -0.4577448 1.4044825 0.1040993 cohorts site 2004 2003 2002 2001 2000 M 5.3569686 2.4391720 1.1980192 1.6214643 -0.5376032 D -4.6083465 -2.0983042 -1.0305993 -1.3948690 0.4624746 cohorts site 1996 M -0.6521494 D 0.5610132 > Xsqagec$stdres # standardized residuals cohorts site 2010 2009 2008 2007 2006 M -3.6665549 -0.9962228 0.7397057 -2.2733888 -0.1623984 D 3.6665549 0.9962228 -0.7397057 2.2733888 0.1623984 cohorts site 2004 2003 2002 2001 2000 M...
2011 Apr 13
0
R 2.13.0 is released
...is an atomic vector with attributes such as names (but no class). dim(x) <- NULL duplicates less if x has neither dimensions nor names (since this operation removes names and dimnames). ? setRepositories() gains an addURLs argument. ? chisq.test() now also returns a stdres component, for standardized residuals (which have unit variance, unlike the Pearson residuals). ? write.table() and friends gain a fileEncoding argument, to simplify writing files for use on other OSes (e.g. a spreadsheet intended for Windows or Mac OS X Excel). ?...
2011 Apr 13
0
R 2.13.0 is released
...is an atomic vector with attributes such as names (but no class). dim(x) <- NULL duplicates less if x has neither dimensions nor names (since this operation removes names and dimnames). ? setRepositories() gains an addURLs argument. ? chisq.test() now also returns a stdres component, for standardized residuals (which have unit variance, unlike the Pearson residuals). ? write.table() and friends gain a fileEncoding argument, to simplify writing files for use on other OSes (e.g. a spreadsheet intended for Windows or Mac OS X Excel). ?...