search for: rstandard

Displaying 20 results from an estimated 32 matches for "rstandard".

Did you mean: standard
2004 Jan 20
2
rstandard.glm() in base/R/lm.influence.R
I contacted John Fox about 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,...
2005 Dec 06
1
standardized residuals (rstandard & plot.lm) (PR#8367)
Full_Name: Heather Turner Version: 2.2.0 OS: Windows XP Submission from: (NULL) (137.205.240.44) Standardized residuals as calculated by rstandard.lm, rstandard.glm and plot.lm are Inf/NaN rather than zero when the un-standardized residuals are zero. This causes plot.lm to break when calculating 'ylim' for any of the plots of standardized residuals. Example: "occupationalStatus" <- structure(as.integer(c(50, 16, 12,...
2004 Feb 24
1
rstandard does not produce standardized residuals
Dear all, the application of the function rstandard() in the base package to a glm object does not produce residuals standardized to have variance one: the reason is that the deviance residuals are divided by the dispersion estimate and not by the square root of the estimate for the dispersion. Should the function not be changed to produce res...
2006 Jan 10
2
standardized residuals (rstandard & plot.lm) (PR#8468)
...So I think we need to return NaN=20 when hat is within rounding error of 1. My take is that plot.lm should handle this: you will see most but not = all=20 cases have na.rm=3DTRUE in calculating ylim, but as Inf is theoretically impossible it has not been considered. Note that plot.lm does not use rstandard and so needs a separate fix. Thanks for the report On Tue, 6 Dec 2005 Heather.Turner at warwick.ac.uk wrote: > Full_Name: Heather Turner > Version: 2.2.0 > OS: Windows XP > Submission from: (NULL) (137.205.240.44) > > > Standardized residuals as calculated by rstandard.lm, r...
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'...
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 deleted]]
2013 Oct 15
1
Q-Q plot scaling in plot.lm(); bug or thinko?
...mber of observations N <- 100 ## binomial sample size d <- data.frame(r=rbinom(n,size=N,prob=0.5), num=N) ## fit with proportion/weights syntax g1 <- glm(r/N~1,family=binomial,weights=num,data=d) ``` The scale of the standardized residuals looks appropriate: ```{r} range(rstandard(g1)) ``` Showing the results of `plot.lm()`, `qqnorm()` on standardized residuals, and th enhanced Q-Q plot from the `mgcv` package: ```{r fig.width=10,fig.height=5} par(mfrow=c(1,3),las=1,bty="l") plot(g1,which=2,main="plot.lm()") qqnorm(rstandard(g1),main="qqnorm()"...
2013 Feb 15
2
Making the plot window wider and using the predict function
...pectively, of a group of cats. With the following code, I am making two plots, both to be viewed in the same plot window in R: library(MASS) maleData <- subset(cats, Sex == "M") linreg0 <- lm(maleData$Hwt ~ maleData$Bwt) par(mfrow=c(1,2)) plot(maleData$Hwt ~ maleData$Bwt) plot(rstandard(linreg0) ~ fitted(linreg0)) My problem is that the two plots end up all oblong and squashed, because the plot window doesn't have a size suited for having two plots next to one another. Can I tell R to adjust the plot window? Also, I would like to do something along the lines of: newData &lt...
2018 Feb 23
2
How to Save the residuals of an LM object greater or less than a certin value to an R object?
...n, and now I want to find out which cases have a residual of above + 2.5 and ? 2.5. Below I provide the R commands I have used. Reg<-lm(a~b+c+d+e+f) # perform multiple regression with a as the dependent variable. Residuals<-residuals(reg) # store residuals to an R object. stdresiduals<-rstandard(reg) #save the standardized residuals. #now I want to type a command that will save the residuals of certain range to an object. I realize that by plotting the data I can quickly see the residuals outside a certain boundtry, however, I am totally blind, so visually inspecting the plot is not...
2011 Aug 10
1
studentized and standarized residuals
Hi, I must be doing something silly here, because I can't get the studentised and standardised residuals from r output of a linear model to agree with what I think they should be from equation form. Thanks in advance, Jennifer x = seq(1,10) y = x + rnorm(10) mod = lm(y~x) rstandard(mod) residuals(mod)/(summary(mod)$sigma) rstudent(mod) residuals(mod)/(summary(mod)$sigma*sqrt(1-lm.influence(mod)$hat)) -- View this message in context: http://r.789695.n4.nabble.com/studentized-and-standarized-residuals-tp3732997p3732997.html Sent from the R help mailing list archive at Nabble.c...
2011 Feb 11
1
censReg or tobit: testing for assumptions in R?
...oskedasticity and nonnormal errors are even more serious problems in a censored regression than in an ols-regression. But I'm not sure how to test for these assumptions in R? Is there a way to get to the residuals of censored regression models (given that corresponding functions for lm, such as rstandard, are not applicable)? (Or perhaps I'm on the wrong track in a more fundamental sense and shouldn't be Iooking for equivalences to lm?) Many thanks for any help. EH
2012 May 03
1
NA's when subset in a dataframe
Dear community, I'm having this silly problem. I've a linear model. After fixing it, I wanted to know which data had studentized residuals larger than 3, so i tried this: d1 <- cooks.distance(lmmodel) r <- sqrt(abs(rstandard(lmmodel))) rstu <- abs(rstudent(lmmodel)) a <- cbind( mydata, d1, r,rstu) alargerthan3 <- a[rstu >3, ] And suddenly a[rstu >3, ] has 17 rows, 7 of them are "new rows", where all the entries are NA's, even its rownames. Because of this I'm not sure of the di...
2016 Apr 26
0
survival::clogit, how to extract residuals for GOF assessment
...) dat.diff$resp <- 1 # response variable is all 1's # Fit on differences and 1's, remove intercept fit.diff <- glm(resp ~ -1 + x1.diff, family = binomial, data = dat.diff) summary(fit.diff) summary(fit.clogit)$coefficients # GOF: delta chi-squared plot(fit.diff$fitted.values, rstandard(fit.diff)^2) round(sort(rstandard(fit.diff)^2), 4) Thanks! Joe [[alternative HTML version deleted]]
2018 Feb 23
0
How to Save the residuals of an LM object greater or less than a certin value to an R object?
...ich cases have a residual of above + 2.5 and ? 2.5. > >Below I provide the R commands I have used. > >Reg<-lm(a~b+c+d+e+f) # perform multiple regression with a as the >dependent variable. > >Residuals<-residuals(reg) # store residuals to an R object. >stdresiduals<-rstandard(reg) #save the standardized residuals. >#now I want to type a command that will save the residuals of >certain range to an object. > >I realize that by plotting the data I can quickly see the residuals >outside a certain boundtry, however, I am totally blind, so visually >ins...
2013 May 01
1
Trouble with methods() after loading gdata package.
...tAIC.lm* family.lm* formula.lm* hatvalues.lm [17] influence.lm* kappa.lm labels.lm* logLik.lm* [21] model.frame.lm model.matrix.lm nobs.lm* plot.lm [25] predict.lm print.lm proj.lm* qr.lm* [29] residuals.lm rstandard.lm rstudent.lm simulate.lm* [33] summary.lm variable.names.lm* vcov.lm* Non-visible functions are asterisked > > library(gdata) gdata: read.xls support for 'XLS' (Excel 97-2004) files ENABLED. gdata: read.xls support for 'XLSX' (Excel 2007+) files ENA...
2006 Aug 31
1
NaN when using dffits, stemming from lm.influence call
....e. Null); 2 Residual Null Deviance: 695.9 Residual Deviance: 0.8535 AIC: 41.25 No problems, errors, or any signs of potential problems. In the changes to R 2.3.0 (in the NEWS file, eg http://mirror.aarnet.edu.au/pub/CRAN/src/base/NEWS) I find this: o Influence measures such as rstandard() and cooks.distance() could return infinite values rather than NaN for a case which was fitted exactly. Similarly, plot.lm() could fail on such examples. plot.lm(which = 5) had to be modified to only plot cases with hat < 1. (PR#8367) lm.influence() was incorrectly reporting 'coef...
2017 Apr 04
0
Some "lm" methods give wrong results when applied to "mlm" objects
...at overall standard deviation (sd) is of length one, but for "mlm" models we have a multivariate response with a multicolumn residual matrix. The functions also get correctly the sd vector corresponding to the columns, but it is not applied to these, but recycled for rows. This influences rstandard.lm and cooks.distance.lm. For instance, in cooks.distance.lm we have ((res/(sd * (1 - hat)))^2 * hat)/p, where res is a n x m matrix, sd is a m-vector and hat is a n-vector). Both of these functions are very easily fixed. 2) Another problem is that several functions are based on lm.influence func...
2010 Feb 17
1
Checking the assumptions for a proper GLM model
Hello, Are there any packages/functions available for testing the assumptions underlying assumptions for a good GLM model? Like linktest in STATA and smilar. If not, could somebody please describe their work process when they check the validity of a logit/probit model? Regards, Jay
2009 Oct 10
2
easy way to find all extractor functions and the datatypes of what they return
Am I asking for too much: for any object that a stat proc returns ( y <- lm( y~x) , etc ) ) , is there a super convenient function like give_all_extractors( y ) that lists all extractor functions , the datatype returned , and a text descriptor field ("pairwisepval" "lsmean" etc) That would just be so convenient. What are my options for querying an object so that I can
2018 Dec 20
0
R 3.5.2 is released
...gth one x and POSIXlt table gave a segfault (PR#17459). * Fork clusters could hang due to a race condition in cluster initialization (makeCluster()). * nextn(n) now also works for larger n and no longer loops infinitely for e.g, n <- 214e7. * cooks.distance() and rstandard() now work correctly for multiple linear models ("mlm"). * polym() and corresponding lm() prediction now also work for a boundary "vector" case fixing PR#17474, reported by Alexandre Courtiol. * With a very large number of variables terms() could segf...