Hi, all, I want to use lowess(x, y) where x and y are vectors of length of 4000+. In fact, x and y are log of some vectors. So, some of the elements are NaN. lowess() can not take away those elements then do the fitting. It will give the error message and do nothing. 1. Can anybody tell me how to get rid of those NaN's and use lowess()? 2. How to get the LOWESS fitting values for any elements in x? Thank you in advance. -MY
A Question on lowess() function
8 messages · Yao, Minghua, Dirk Eddelbuettel, Brian Ripley +2 more
lowess was old-fashioned a decade ago: use loess. And this Q was answered about a week ago, so use the archives.
On Thu, 10 Apr 2003, Minghua Yao wrote:
I want to use lowess(x, y) where x and y are vectors of length of 4000+. In fact, x and y are log of some vectors. So, some of the elements are NaN. lowess() can not take away those elements then do the fitting. It will give the error message and do nothing. 1. Can anybody tell me how to get rid of those NaN's and use lowess()? 2. How to get the LOWESS fitting values for any elements in x?
Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
Thank you for your reply. I didn't find what I needed from the archieves. Maybe, I need to figure out how to search the archieves effectively. I used y<-x[!is.na(x)] to get rid of NA and NaN. But I don't know how to get rid of Inf. Also, is there more detailed info about loess() than help(loess)? Thanks. -MY -----Original Message----- From: Prof Brian Ripley [mailto:ripley at stats.ox.ac.uk] Sent: Thursday, April 10, 2003 1:38 PM To: Minghua Yao Cc: r-help at stat.math.ethz.ch Subject: Re: [R] A Question on lowess() function lowess was old-fashioned a decade ago: use loess. And this Q was answered about a week ago, so use the archives.
On Thu, 10 Apr 2003, Minghua Yao wrote:
I want to use lowess(x, y) where x and y are vectors of length of 4000+.
In
fact, x and y are log of some vectors. So, some of the elements are NaN. lowess() can not take away those elements then do the fitting. It will
give
the error message and do nothing. 1. Can anybody tell me how to get rid of those NaN's and use lowess()? 2. How to get the LOWESS fitting values for any elements in x?
-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
On Thu, Apr 10, 2003 at 02:58:15PM -0500, Minghua Yao wrote:
I used y<-x[!is.na(x)] to get rid of NA and NaN. But I don't know how to get rid of Inf.
y<-x[is.finite(x)] # remove NA,NaN,and Inf all at once
Also, is there more detailed info about loess() than help(loess)?
help(loess) offers a references to the literature. It doesn't get much more detailed than papers in scholarly journals and books. Dirk
Wishful thinking can dominate much of the work of a profession for a decade, but not indefinitely. -- Robert Shiller, on Efficient Markets models, 2002
On Thu, 10 Apr 2003, Minghua Yao wrote:
Thank you for your reply. I didn't find what I needed from the archieves. Maybe, I need to figure out how to search the archieves effectively. I used y<-x[!is.na(x)] to get rid of NA and NaN. But I don't know how to get rid of Inf.
That's not what you asked for, and is.finite() will do that (if you apply it to x as well).
Also, is there more detailed info about loess() than help(loess)?
Look at the na.action parameter ..., as well as the references.
Thanks. -MY -----Original Message----- From: Prof Brian Ripley [mailto:ripley at stats.ox.ac.uk] Sent: Thursday, April 10, 2003 1:38 PM To: Minghua Yao Cc: r-help at stat.math.ethz.ch Subject: Re: [R] A Question on lowess() function lowess was old-fashioned a decade ago: use loess. And this Q was answered about a week ago, so use the archives. On Thu, 10 Apr 2003, Minghua Yao wrote:
I want to use lowess(x, y) where x and y are vectors of length of 4000+.
In
fact, x and y are log of some vectors. So, some of the elements are NaN. lowess() can not take away those elements then do the fitting. It will
give
the error message and do nothing. 1. Can anybody tell me how to get rid of those NaN's and use lowess()? 2. How to get the LOWESS fitting values for any elements in x?
Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
The following should solve one of your questions below: > is.finite(c(1, Inf)) [1] TRUE FALSE Spencer Graves
Minghua Yao wrote:
Thank you for your reply. I didn't find what I needed from the archieves. Maybe, I need to figure out how to search the archieves effectively. I used y<-x[!is.na(x)] to get rid of NA and NaN. But I don't know how to get rid of Inf. Also, is there more detailed info about loess() than help(loess)? Thanks. -MY -----Original Message----- From: Prof Brian Ripley [mailto:ripley at stats.ox.ac.uk] Sent: Thursday, April 10, 2003 1:38 PM To: Minghua Yao Cc: r-help at stat.math.ethz.ch Subject: Re: [R] A Question on lowess() function lowess was old-fashioned a decade ago: use loess. And this Q was answered about a week ago, so use the archives. On Thu, 10 Apr 2003, Minghua Yao wrote:
I want to use lowess(x, y) where x and y are vectors of length of 4000+.
In
fact, x and y are log of some vectors. So, some of the elements are NaN. lowess() can not take away those elements then do the fitting. It will
give
the error message and do nothing. 1. Can anybody tell me how to get rid of those NaN's and use lowess()? 2. How to get the LOWESS fitting values for any elements in x?
-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
______________________________________________ R-help at stat.math.ethz.ch mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
I still haven't found out from the mail archieves How to get the LOWESS or LOESS fitting values for any elements in x? Help please. Thanks. -MY -----Original Message----- From: Prof Brian Ripley [mailto:ripley at stats.ox.ac.uk] Sent: Thursday, April 10, 2003 3:21 PM To: Minghua Yao Cc: r-help at stat.math.ethz.ch Subject: RE: [R] A Question on lowess() function
On Thu, 10 Apr 2003, Minghua Yao wrote:
Thank you for your reply. I didn't find what I needed from the archieves. Maybe, I need to figure
out
how to search the archieves effectively. I used y<-x[!is.na(x)] to get rid of NA and NaN. But I don't know how to
get
rid of Inf.
That's not what you asked for, and is.finite() will do that (if you apply it to x as well).
Also, is there more detailed info about loess() than help(loess)?
Look at the na.action parameter ..., as well as the references.
Thanks. -MY -----Original Message----- From: Prof Brian Ripley [mailto:ripley at stats.ox.ac.uk] Sent: Thursday, April 10, 2003 1:38 PM To: Minghua Yao Cc: r-help at stat.math.ethz.ch Subject: Re: [R] A Question on lowess() function lowess was old-fashioned a decade ago: use loess. And this Q was answered about a week ago, so use the archives. On Thu, 10 Apr 2003, Minghua Yao wrote:
I want to use lowess(x, y) where x and y are vectors of length of 4000+.
In
fact, x and y are log of some vectors. So, some of the elements are NaN. lowess() can not take away those elements then do the fitting. It will
give
the error message and do nothing. 1. Can anybody tell me how to get rid of those NaN's and use lowess()? 2. How to get the LOWESS fitting values for any elements in x?
-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
Minghua Yao <myao at ou.edu> writes:
I still haven't found out from the mail archieves How to get the LOWESS or LOESS fitting values for any elements in x? Help please. Thanks.
Not to put too fine a point on it: This is contained in the example in help(loess) and help(predict.loess)!
O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907