Re: [R] Loess fit

2010-05-17 Thread Liaw, Andy
I'm just guessing (since as David pointed out, no reproducible example were given), but this perhaps could be the problem: R> x <- 1:10 R> y <- rnorm(x) R> fm <- loess(y ~ x) R> predict(fm, data.frame(x=5:15)) [1] 0.1830450 0.2145826 -0.2158466 -0.3051978 -0.2635318 -0.1013985 [7] NA

Re: [R] Loess fit

2010-05-17 Thread David Winsemius
On May 17, 2010, at 4:47 AM, Chintanu wrote: Hi, I wonder why my attempt to extend an existing loess fit to a new data set is producing error. I was trying the following: dat = read.csv(choose.files()) x = dat[,2]; y = dat[,1] x.sort = sort(x) That is not needed, furthermore, you don't e

[R] Loess fit

2010-05-17 Thread Chintanu
Hi, I wonder why my attempt to extend an existing loess fit to a new data set is producing error. I was trying the following: dat = read.csv(choose.files()) x = dat[,2]; y = dat[,1] x.sort = sort(x) y.loess = loess(y~x, span=0.75) # For testing the above fit with a new dataset: test = read.csv(

Re: [R] Loess Fit

2010-04-18 Thread Tal Galili
> > project.org] On Behalf Of Karl Ove Hufthammer > > Sent: Tuesday, November 24, 2009 1:11 AM > > To: r-h...@stat.math.ethz.ch > > Subject: Re: [R] Loess Fit > > > > On Mon, 23 Nov 2009 14:03:11 -0700 Greg Snow > > wrote: > > > If you need a fu

Re: [R] Loess Fit

2009-11-24 Thread Greg Snow
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of Karl Ove Hufthammer > Sent: Tuesday, November 24, 2009 1:11 AM > To: r-h...@stat.math.ethz.ch > Subject: Re: [R] Loess Fit > > On Mon, 23 Nov 2009

Re: [R] Loess Fit

2009-11-24 Thread Karl Ove Hufthammer
On Mon, 23 Nov 2009 14:03:11 -0700 Greg Snow wrote: > If you need a function to reproducibly generate predictions, then > use loess to generate a set of predictions for a reasonably dense set > of x-values, then use approxfun or splinefun to create a function to > interpolate for you. Then th

Re: [R] Loess Fit

2009-11-23 Thread Greg Snow
enter Intermountain Healthcare greg.s...@imail.org 801.408.8111 From: Christian Miner [mailto:christian.mi...@gmail.com] Sent: Monday, November 23, 2009 2:13 PM To: Greg Snow Cc: Thomas S. Dye; r-help@r-project.org Subject: Re: [R] Loess Fit What if you wanted to do this with multiple x's, mu

Re: [R] Loess Fit

2009-11-23 Thread Christian Miner
@imail.org > > 801.408.8111 > > > > *From:* Christian Miner [mailto:christian.mi...@gmail.com] > *Sent:* Monday, November 23, 2009 2:05 PM > *To:* Greg Snow > *Cc:* Thomas S. Dye; r-help@r-project.org > > *Subject:* Re: [R] Loess Fit > > > > Thanks, I&#

Re: [R] Loess Fit

2009-11-23 Thread Greg Snow
. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 From: Christian Miner [mailto:christian.mi...@gmail.com] Sent: Monday, November 23, 2009 2:05 PM To: Greg Snow Cc: Thomas S. Dye; r-help@r-project.org Subject: Re: [R] Loess Fit Thanks, I'll try

Re: [R] Loess Fit

2009-11-23 Thread Christian Miner
ntain Healthcare > greg.s...@imail.org > 801.408.8111 > > > > -Original Message- > > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > > project.org] On Behalf Of Thomas S. Dye > > Sent: Monday, November 23, 2009 1:39 PM > > To: Christian

Re: [R] Loess Fit

2009-11-23 Thread Greg Snow
Behalf Of Thomas S. Dye > Sent: Monday, November 23, 2009 1:39 PM > To: Christian Miner > Cc: r-help@r-project.org > Subject: Re: [R] Loess Fit > > Thanks Christian. The client is always right ... > > Tom > > On Nov 23, 2009, at 10:32 AM, Christian Miner wrote: >

Re: [R] Loess Fit

2009-11-23 Thread Thomas S. Dye
Thanks Christian. The client is always right ... Tom On Nov 23, 2009, at 10:32 AM, Christian Miner wrote: > sorry, I don't. I have data that I can estimate, but my client wants > to "What if..." 20 separate scenarios, and that requires a function. > > On Mon, Nov 23, 2009 at 12:22 PM, Thomas

Re: [R] Loess Fit

2009-11-23 Thread Greg Snow
Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of Christian Miner > Sent: Monday, November 23, 2009 12:04 PM > To: r-help@r-project.org > Subject: [R] Loess Fit > > I'm working on Loess fit models using R, once I have the

Re: [R] Loess Fit

2009-11-23 Thread Thomas S. Dye
Hi Christian, Do you have a reference to a publication where this has been done? All the best, Tom On Nov 23, 2009, at 10:15 AM, Christian Miner wrote: > it's a tricky maneuver. When I finish the fit, the predict function > will give me the values, and I can smooth this out so it looks like

Re: [R] Loess Fit

2009-11-23 Thread David Winsemius
On Nov 23, 2009, at 2:03 PM, Christian Miner wrote: I'm working on Loess fit models using R, once I have the fit accomplished, I'm looking to back-out the equation of the fitted non-linear curve, wondering if there is a way to determine this equation in R? I've been looking but can't find any

[R] Loess Fit

2009-11-23 Thread Christian Miner
I'm working on Loess fit models using R, once I have the fit accomplished, I'm looking to back-out the equation of the fitted non-linear curve, wondering if there is a way to determine this equation in R? I've been looking but can't find any literature. For me, the graph of the function is great, b