[R] cannot calculate standard estimate with predict on loess
David Winsemius
dwinsemius at comcast.net
Fri May 4 16:39:29 CEST 2012
On May 3, 2012, at 7:10 PM, Saurav Pathak wrote:
> Hi,
>
> For some reason I have been unable to use the predict function when
> I desire the standard error to be calculated too. For example, when
> I try the following:
>
> l<- loess(d~x+y, span=span, se=TRUE)
> p<- predict(l, se=TRUE)
>
I don't know what effect the se=TRUE will have in the first call. As
far as I can tell there is no such argument to loess(). Could it be
that the extranous argument is have an adverse effect on the effort to
later use predict (which does have such an argument.)?
>
> I get the following error message:
>
> Error in vector("double", length) : vector size cannot be NA
> In addition: Warning message:
> In N * M1 : NAs produced by integer overflow
>
>
> But when I try the following:
>
> l<- loess(d~x+y, span=span, se=TRUE)
> p<- predict(l, se=FALSE)
>
>
> I have no problem, and p$fit gives me the desired fitted values.
> Note that the only difference in this piece of code is se=FALSE.
>
> My data d is a vector, and x and y are vectors too of the same length.
>
> Any help will be greatly appreciated.
>
> Thanks,
> Saurav
>
> ______________________________________________
> 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.
David Winsemius, MD
Heritage Laboratories
West Hartford, CT
More information about the R-help
mailing list