Message-ID: <AE69DC3B-878C-4AD2-8178-5F40C3ECB5E4@comcast.net>
Date: 2011-10-16T22:23:18Z
From: David Winsemius
Subject: Suppressing the Intercept in lm() when using a dataframe for the model
In-Reply-To: <1318794918528-3910327.post@n4.nabble.com>
On Oct 16, 2011, at 3:55 PM, Cliff Clive wrote:
> It's easy to run a linear regression on a simple model without an
> intercept
> just by doing this:
>
> lm(y ~ x1 + x2 -1)
>
>
> Is there a similar trick to suppress the intercept when your model
> is in a
> large dataframe and you don't want to write out the names of
> individual
> columns?
Something along the lines of:
lm(y ~ . -1, data=dfrm)
But you do need to offer specific examples to get specific answers.
(Hence the usual advice to read the Posting Guide.)
>
--
David Winsemius, MD
Heritage Laboratories
West Hartford, CT