Skip to content
Back to formatted view

Raw Message

Message-ID: <cafd80eb-73e7-0109-e224-6d1a53a2a63c@gmail.com>
Date: 2016-05-23T11:41:57Z
From: Duncan Murdoch
Subject: meaning of lm( y~., data=mydat ), is it a language feature, is it documented, is it supported?
In-Reply-To: <5742B0A3020000CB001550DE@smtp.medicine.umaryland.edu>

On 23/05/2016 7:26 AM, John Sorkin wrote:
>
> The syntax
> mydat <- data.frame( y,x )
> fit1 <- lm( y~., data=mydat )
> appears to perform a multivariable regression of y on every non-y variable in the data frame mydat. I can not find this syntax (y~.) in R documentation. Is y~. a supported feature of the R language? Where can I find it documented? I would hate to write code that is dependent on a non-supported, non-documented language feature.

It is documented in the Introduction to R manual (hidden in section 
11.5, "Updating fitted models"), and in ?formula, which ?lm refers to.

Duncan Murdoch