search for: naresid

Displaying 15 results from an estimated 15 matches for "naresid".

Did you mean: baresip
2002 May 20
1
suggestion for example for base:naresid
Dear list: since it took me a little while to figure out how to make use of naresid, I thought that the below R code might be useful as an example on the help page. Regards, Markus # generate some data x1 <- runif(20) y <- 10 + 5*x1 + rnorm(20) summary(lm.0 <- lm(y ~ x1)) # append some NA's to y y <- c(y, rep(NA, 5)) # generate some further x1s x1 <- c(x1,...
2001 Aug 29
1
suggestion for example for base:naresid
Dear list: since it took me a little while to figure out how to make use of naresid, I thought that the below R code might be useful as an example on the help page. Regards, Markus # generate some data x1 <- runif(20) y <- 10 + 5*x1 + rnorm(20) summary(lm.0 <- lm(y ~ x1)) # append some NA's to y y <- c(y, rep(NA, 5)) # generate some further x1s x1 <- c(x1,...
2011 Jan 14
1
naresid.exclude query
x <- NA na.act <- na.action(na.exclude(x)) y <- rep(0,0) naresid(na.act,y) ... currently produces the result... numeric(0) ... whereas the documentation might lead you to expect NA The behaviour is caused by the line if (length(x) == 0L) return(x) in `stats:::naresid.exclude'. Removing this line results in the behaviour I'd expected in the ab...
2003 Apr 26
1
predict/residual
I am having trouble understanding the way naresid is used when using predict/residual in a new data frame. >From the example below, the NAs are displayed when predicting inside the original frame, but are dropped when applied to a new frame. ultimately I need to cbind the residuals and predictions to a dataframe. Any help would be appreciate...
2014 Mar 06
1
makepredictcall
...id in creating code for a new transformation function. Did I miss something? If not, I'd be willing to draft a paragraph about that which could be added to the extensions document. I figured it out, somehow, for the pspline function of the survival package. Submit such draft to ____? The naresid function would be another useful addition. Terry Therneau
2004 Mar 28
2
residuals with missing values
...t not make more sense to have the residuals propagate the missing values, so that the residuals are guaranteed to have the same length as the variables? Alternatively, maybe the residuals() function could do this instead. But the documentation is not clear: Methods can make use of 'naresid' methods to compensate for the omission of missing values. The default method does. How? I have figured out how to write my own function to do what I need (using the names of the residuals object), so this is more a "how to properly do this?" question, and/or "suggestio...
2011 Mar 10
1
Problem with defining new method for residuals()
...t execute the code manually it get no error. Any suggestions? Best regards, Thierry The entire source code is at svn://scm.r-forge.r-project.org/svnroot/aflp The code with the error. > normalise(dummy) Error in object$na.action : $ operator not defined for this S4 class > traceback() 5: naresid(object$na.action, object$residuals) at normalise.R#30 4: residuals.default(outliers(data)) at normalise.R#30 3: residuals(outliers(data)) at normalise.R#30 2: nrow(residuals(outliers(data))) at normalise.R#30 1: normalise(dummy) #This works fine > data <- dummy > nrow(residuals(outliers(da...
2008 Dec 28
1
model.matrix and missing values
Hi, Does anyone know an easy way of retaining rows in a model.matrix where missing values are present in the predictors. Ideally I'd be able to retain these rows as zeros. Thanks, Jarrod -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336.
2014 Mar 07
0
R makepredictcall
...miss something? >> > >> >If not, I'd be willing to draft a paragraph about that which could be >> >added to the extensions document. I figured it out, somehow, for the >> >pspline function of the survival package. Submit such draft to ____? >> >The naresid function would be another useful addition. >> > >> >Terry Therneau >> > >> >______________________________________________ >> >
2007 Dec 03
3
restore NAs in residuals
Dear All, I have two vectors: tt = c(6.87, 7.43, 6.4, 4.5, 5.5, 5.87, NA, NA, NA, 7.7) year = 1966:1975 Residuals lm(tt~year)$res do not contain NAs for the three years of missing temperature tt. Is there a simple way to get these NAs back into the residual's vector? Thank you, Sorama [[alternative HTML version deleted]]
2003 Jan 30
2
mgcv, gam
Hola! I have some problems with gam in mgcv. Firts a detail: it would be nice igf gam would accept an na.action argument, but that not the main point. I want to have a smooth term for time over a year, the same pattern repeating in succesive years. It would be natural then to impose the condition s(0)=s(12). Is this possible within mgcv? I tried to obtain this with trigonometric terms, aca:
2003 Dec 09
1
documentation fixes (cvs) (PR#5632)
...to pad the object with \code{NA}s in the correct positions to + The default methods do nothing. The default method for the \code{na.exclude} + action is to pad the object with \code{NA}s in the correct positions to have the same number of rows as the original data frame. Currently \code{naresid} and \code{napredict} are identical, but Index: src/library/stats/man/nlm.Rd =================================================================== RCS file: /cvs/R/src/library/stats/man/nlm.Rd,v retrieving revision 1.1 diff -u -r1.1 nlm.Rd --- src/library/stats/man/nlm.Rd 2003/12/09 07:24:24 1.1 +++...
2011 Feb 25
0
R 2.12.2 is released
...(PR#14473) ? The rendering of numbers in plotmath expressions (e.g. expression(10^2)) used the current settings for conversion to strings rather than setting the defaults, and so could be affected by what has been done before. (PR#14477) ? The methods of napredict() and naresid() for na.action = na.exclude fits did not work correctly in the very rare event that every case had been omitted in the fit. (Reported by Simon Wood.) ? weighted.residuals(drop0=TRUE) returned a vector when the residuals were a matrix (e.g. those of class "mlm&quo...
2011 Feb 25
0
R 2.12.2 is released
...(PR#14473) ? The rendering of numbers in plotmath expressions (e.g. expression(10^2)) used the current settings for conversion to strings rather than setting the defaults, and so could be affected by what has been done before. (PR#14477) ? The methods of napredict() and naresid() for na.action = na.exclude fits did not work correctly in the very rare event that every case had been omitted in the fit. (Reported by Simon Wood.) ? weighted.residuals(drop0=TRUE) returned a vector when the residuals were a matrix (e.g. those of class "mlm&quo...
2003 Dec 12
0
proofreading corrections (cvs) (PR#5730)
...to pad the object with \code{NA}s in the correct positions to + The default methods do nothing. The default method for the \code{na.exclude} + action is to pad the object with \code{NA}s in the correct positions to have the same number of rows as the original data frame. Currently \code{naresid} and \code{napredict} are identical, but Index: src/library/stats/man/nlm.Rd =================================================================== RCS file: /cvs/R/src/library/stats/man/nlm.Rd,v retrieving revision 1.2 diff -u -r1.2 nlm.Rd --- src/library/stats/man/nlm.Rd 2003/12/11 07:16:06 1.2 +++...