[R] Selecting a random sample for lmList()

John Fox jfox at mcmaster.ca
Mon Oct 6 17:21:09 CEST 2003


Dear Harold,

There are examples of sampling and plotting hierarchical and longitudinal 
data in this manner in the appendix on mixed models to my R and S-PLUS 
Companion to Applied Regression; the appendix is available at 
<http://socserv.socsci.mcmaster.ca/jfox/Books/Companion/appendix-mixed-models.pdf>.

I hope that this helps,
  John

At 10:50 AM 10/6/2003 -0400, you wrote:
>Dear List:
>
>I have a data set with over 7000 students with about 4 observations over 
>time per student. I want to examine the within-group fits of a random 
>sample of this group as it takes forever to compute and draw all 7000 
>regressions.
>
>Here is the code I have used so far.
>
> >group<-groupedData(math~year|childid, data=scores)
> >group.list<-lmList(group)
> >plot(augPred(group.list))
>
>How might I select a random sample of say 100 students so that I can 
>visually examine their trajectories?
>
>Thank you
>

-----------------------------------------------------
John Fox
Department of Sociology
McMaster University
Hamilton, Ontario, Canada L8S 4M4
email: jfox at mcmaster.ca
phone: 905-525-9140x23604
web: www.socsci.mcmaster.ca/jfox




More information about the R-help mailing list