Re: [R] glm: formula vs character

2010-09-18 Thread Thomas Lumley
On Fri, 17 Sep 2010, Greg Snow wrote: I think what is going on (and someone is likely to correct me otherwise) is that formulas have an associated environment that gets passed along with them while character strings do not. Yes. model.frame(), which is called from most modelling functions,

Re: [R] glm: formula vs character

2010-09-17 Thread Greg Snow
age- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of Krishna Tateneni > Sent: Thursday, September 16, 2010 4:56 PM > To: r-help > Subject: [R] glm: formula vs character > > Hello, > > This is a question motivated by curiosity

[R] glm: formula vs character

2010-09-16 Thread Krishna Tateneni
Hello, This is a question motivated by curiosity, not a pressing problem. Any responses are much appreciated! In the following code, function reg1 calls glm with a formula object while reg2 uses a string. In both cases, glm works; however, in the second case, the add1 function fails with the fo