Dear all
I have a work-flow issue with lm(). When I use
lm(y1~x1, anscombe)
Call:
lm(formula = y1 ~ x1, data = anscombe)
Coefficients:
(Intercept) x1
3.0001 0.5001
I get as expected the formula, y1 ~ x1, in the print()ed results or
summary(). However, if I pass through a
On 24/11/2011 2:48 PM, Liviu Andronic wrote:
Dear all
I have a work-flow issue with lm(). When I use
lm(y1~x1, anscombe)
Call:
lm(formula = y1 ~ x1, data = anscombe)
Coefficients:
(Intercept) x1
3.0001 0.5001
I get as expected the formula, y1 ~ x1, in the print()ed
On Thu, Nov 24, 2011 at 9:14 PM, Duncan Murdoch
murdoch.dun...@gmail.com wrote:
It is retained. terms(fit) will give it to you, if fit is an lm object.
Thank you. The following works nicely.
(form - formula(y1~x1))
y1 ~ x1
x - lm(form, anscombe)
formula(terms(x))
y1 ~ x1
However, I was
On Thu, 24 Nov 2011, Liviu Andronic wrote:
On Thu, Nov 24, 2011 at 9:14 PM, Duncan Murdoch
murdoch.dun...@gmail.com wrote:
It is retained. terms(fit) will give it to you, if fit is an lm object.
Thank you. The following works nicely.
(form - formula(y1~x1))
y1 ~ x1
x - lm(form,
On Thu, Nov 24, 2011 at 10:25 PM, Prof Brian Ripley
rip...@stats.ox.ac.uk wrote:
Yes. That's a job for substitute (the second time today).
form - formula(y1~x1)
x - eval(substitute(lm(f, anscombe), list(f = form)))
summary(x)
Call:
lm(formula = y1 ~ x1, data = anscombe)
That's what I
On Thu, Nov 24, 2011 at 2:48 PM, Liviu Andronic landronim...@gmail.com wrote:
Dear all
I have a work-flow issue with lm(). When I use
lm(y1~x1, anscombe)
Call:
lm(formula = y1 ~ x1, data = anscombe)
Coefficients:
(Intercept) x1
3.0001 0.5001
I get as expected the
You would get exactly the same problem with ...,, anway.
Here's a commonly used approach in R sources:
x.lm - function(formula, data, ...)
{
Call - match.call(expand.dots = TRUE)
Call[[1]] - as.name(lm)
Call$formula - as.formula(terms(formula))
eval(Call)
}
On Thu, 24 Nov
On Thu, Nov 24, 2011 at 11:55 PM, Prof Brian Ripley
rip...@stats.ox.ac.uk wrote:
You would get exactly the same problem with ...,, anway.
Here's a commonly used approach in R sources:
x.lm - function(formula, data, ...)
{
Call - match.call(expand.dots = TRUE)
Call[[1]] - as.name(lm)
8 matches
Mail list logo