[R] Difficulty with 'loess' function

2011-03-18 Thread armstrwa
Hi, I am trying to create a loess smooth from hydrologic data. My goal is to create a smooth line that describes discharge at a certain point in time. I have done this using the 'lowess' function and had no problem, but I'm having some difficulty with loess. I am inputting the date ('date')

Re: [R] Difficulty with 'loess' function

2011-03-18 Thread Bert Gunter
Well, you might start by reading the Help file for loess and specifying the model via a formula, as described there. The docs say your input is coerced to a formula -- but obviously not the one you want. Specify it explicitly. -- Bert On Fri, Mar 18, 2011 at 8:34 AM, armstrwa

Re: [R] Difficulty with 'loess' function

2011-03-18 Thread armstrwa
Yeah, I did look at the help(loess) page, but I wasn't really sure what to do with that. I was inputting it as: test-loess(date ~ q,data.frame(date,q),span=0.5) test Call: loess(formula = date ~ q, data = data.frame(date, q), span = 0.5) Number of Observations: 96 Equivalent Number of

Re: [R] Difficulty with 'loess' function

2011-03-18 Thread nblarson
Flip date and q in your formula, you've got them backwards from what you've said you're trying to model. armstrwa wrote: Yeah, I did look at the help(loess) page, but I wasn't really sure what to do with that. I was inputting it as: test-loess(date ~ q,data.frame(date,q),span=0.5)

Re: [R] Difficulty with 'loess' function

2011-03-18 Thread armstrwa
lt;!DOCTYPE html PUBLIC quot;-//W3C//DTD HTML 4.01 Transitional//ENquot;gt; That would certainly help, haha.nbsp; Thank you for catching that error.nbsp; Do you happen to know what exactly '~' means in R? Thanks again. Billy nblarson [via R] wrote: Flip date and q in your formula,

Re: [R] Difficulty with 'loess' function

2011-03-18 Thread David Winsemius
On Mar 18, 2011, at 4:00 PM, armstrwa wrote: lt;!DOCTYPE html PUBLIC quot;-//W3C//DTD HTML 4.01 Transitional// ENquot;gt; That would certainly help, haha.nbsp; Thank you for catching that error.nbsp; Do you happen to know what exactly '~' means in R? ?formula It separates the left