Re: [R] How to make array of regression objects

From: Dmitrij Kudriavcev <dimitrij.kudriavcev_at_ntsg.lt>
Date: Wed, 18 May 2011 22:57:09 +1000

Thank you, Ista, that exactly, what i was looking for :)

Regards,
Dmitrij Kudriavcev

2011/5/18 Ista Zahn <izahn_at_psych.rochester.edu>

> Hi Dmitrij,
> I think the usual way is to store the results in a list:
>
> o <- list()
> o[[1]] <- lrm(...)
> o[[2]] <- lrm(...)
> o[[...]] <-lrm(...)
>
> then you can access the results like 0[[1]], 0[[2]] ...
>
> Best,
> Ista
>
> On Tue, May 17, 2011 at 11:53 PM, Dmitrij Kudriavcev
> <dimitrij.kudriavcev_at_ntsg.lt> wrote:
> > Dear all,
> >
> > I have made couple logistic regressions, what making a distribution of
> some
> > event.
> >
> > Currently, i store it like this:
> >
> > o1 <- lrm(...)
> > o2 <- lrm(...)
> > o3 <- lrm(...)
> > ...
> >
> > Then, i have made a function to peak required regression object from this
> > variables by it number:
> >
> > get_object <- function(obj_name, nModel) {
> > eval (parse(text=paste("o <- ", obj_name, nModel, sep="")))
> > o
> > }
> >
> > Is there a better way to do it? I have try to store it in the matrix
> using
> > data.frame(), but object become destroyed after that and predict()
> function
> > do not recognize it.
> >
> > Regards,
> > Dmitrij Kudriavcev
> >
> > [[alternative HTML version deleted]]
> >
> > ______________________________________________
> > R-help_at_r-project.org 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.
> >
>
>
>
> --
> Ista Zahn
> Graduate student
> University of Rochester
> Department of Clinical and Social Psychology
> http://yourpsyche.org
>

        [[alternative HTML version deleted]]



R-help_at_r-project.org 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 Wed 18 May 2011 - 13:13:28 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 18 May 2011 - 13:30:08 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.

list of date sections of archive