Re: [R] anova for the objects of list

From: Hai Lin <kevinvol2002_at_yahoo.com>
Date: Tue 06 Jun 2006 - 04:35:14 EST


Dear R experts,

Sorry for the previous email. I just figured it out myself. I would welcome other solutions.

Thanks.
Kevin

my.anova <- sapply(names(my.x),

                               function(x)
                               {
                               anova(my.x[[x]],
my.x1[[x]])
                               }
                                 )

> Dear R experts,
>
> I have two list objects from runing lme model for
> each
> subjects. And my.x is the full model with all terms
> I
> am interested in and my.x1 is the null model with
> only
> intercept.
>
> I am trying to compare two models at each subject
> level. (Doing anova(my.x[[1]], my.x1[[1]]) is to
> produce stats for the first subject). My goal is to
> obtain stats. for an entire set with hundreds of
> subjects. I did something like this, lapply(my.Tem,
> function(x)anova(x)), but my.Tem actually is not a
> list after combining. It did not work the way as I
> expected.
>
> I am very thankful if anyone here could point me
> out.
>
> Kevin
>
> ####
> 5 subjects extracted as my pilot data.
> > class(my.x)
> [1] "list"
> > length(my.x)
> [1] 5
> > class(my.x1)
> [1] "list"
> > length(my.x1)
> [1] 5
>
> ####
> my.Tem <- cbind(my.x, my.x1)
> > class(my.Tem)
> [1] "matrix"
> > my.Tem
> my.x my.x1
> s1 List,15 List,15
> s2 List,15 List,15
> s3 List,15 List,15
> s4 List,15 List,15
> s5 List,15 List,15
>
>
> __________________________________________________
> Do You Yahoo!?

> protection around
> http://mail.yahoo.com
>



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 Received on Tue Jun 06 04:41:26 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 Tue 06 Jun 2006 - 06:10:35 EST.

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