[R] Difficulty with 'loess' function

David Winsemius dwinsemius at comcast.net
Fri Mar 18 22:19:16 CET 2011


On Mar 18, 2011, at 4:00 PM, armstrwa wrote:

> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional// 
> EN">
>
>
>
>
>
> That would certainly help, haha.  Thank you for catching that  
> error. 
> Do you happen to know what exactly '~' means in R?

?formula

It separates the left hand side of a formula from the right hand side.  
Generally that means that the left hand side is taken as some sort of  
"Y" or dependent varialbe and the RHS as the predictors, but formulas  
can be used by funstions that do not have tha t interpretation. Your  
use as date ~ q meant that you were predicting 'date' from values of  
'q'.

-- 
David.



>
> Thanks again.
>
> Billy
>
> nblarson [via R] wrote:
> 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)
>
>
> So I guess I'm inputting the formula wrong then?  But from  
> looking at
> the help(formula) page, I still wasn't sure what it's looking for.
>
>
> Thanks.
>
>
> Billy
>
>
>
>
>
>
>
>  If you reply to this email, your
> message will be added to the discussion below:
>  http://r.789695.n4.nabble.com/Difficulty-with-loess-function-tp3387537p3388108.html
>
>
> To unsubscribe from Difficulty with 'loess' function, click
> here .
>
>
> -- 
> William Armstrong
> Hydrology Research Assistant
> NOAA Restoration Center
> 55 Great Republic Drive
> Gloucester, MA 01930
>
> email: william.armstrong at noaa.gov
> ph: 978-675-2181
>
>
>
>
> --
> View this message in context: http://r.789695.n4.nabble.com/Difficulty-with-loess-function-tp3387537p3388273.html
> Sent from the R help mailing list archive at Nabble.com.
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> 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
West Hartford, CT



More information about the R-help mailing list