Re: [R] extract data from lm object and then use again?

From: Thilo Kellermann <tkellermann_at_ukaachen.de>
Date: Fri 22 Sep 2006 - 15:04:56 GMT

Hi,

the data of the model fit is stored in lm$model and should work....

Good luck,
Thilo

On Friday 22 September 2006 16:45, Mike Wolfgang wrote:
> Hi list,
>
> I want to write a general function so that it would take an lm object,
> extract its data element, then use the data at another R function (eg,
> glm). I searched R-help list, and found this would do the trick of the
> first part: a.lm$call$data
> this would return a name object but could not be recognized as a
> data.frameby glm. I also tried
> call(as.character(a.lm$call$data))
> or
> eval(call(as.character(a.lm$call$data)))
> neither works.
>
> By eval(call(...)), it acts as evaluating of a function, but what I want is
> just a data frame object which could be inserted into glm function. Anyone
> could help? Thanks,
>
> Mike
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html and provide commented, minimal,
> self-contained, reproducible code.

-- 
________________________
Thilo Kellermann
Department of Psychiatry und Psychotherapy
RWTH Aachen University
Pauwelstr. 30
52074 Aachen
Tel.: +49 (0)241 / 8089977
Fax.: +49 (0)241 / 8082401
E-Mail: tkellermann@ukaachen.de

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Sat Sep 23 01:19:14 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Fri 22 Sep 2006 - 16:30:47 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.