[R] meaning of glm(value ~ .,

David Winsemius dwinsemius at comcast.net
Fri Jun 19 15:24:29 CEST 2009


On Jun 19, 2009, at 9:00 AM, onyourmark wrote:

>
> I am trying to build a glm model with many inputs.
> I saw the following code in Rattle
> crs$glm <- glm(value ~ ., data=crs$dataset[,c(1:59,922)],
> family=binomial(link="logit"))
>
> I am not clear about what
>
> value ~ .

Generally the "." in a formula indicates all of the remaining  
variables without interactions.

?"formula"   # although I did not find that particular convention  
documented in a cursory review of that page .

>
> means and also, I see
>
> data=crs$dataset[,c(1:59,922)]
>
> I have read that the data argument is optional here
> "an optional data frame, list or environment (or object coercible by
> as.data.frame to a data frame) containing the variables in the  
> model. If not
> found in data, the variables are taken from environment(formula),  
> typically
> the environment from which glm is called"
>
> when they say "data", is that meant to include the dependent  
> variable as
> well.

Yes.

> In other words,
> in the above statement 'value' is the dependent variable and it is  
> also
> column 922 in the data set.
> Is this correct?

Yes.

> correct
> Thank you.
>
> -- 


David Winsemius, MD
Heritage Laboratories
West Hartford, CT




More information about the R-help mailing list