[R] nested random effects

Federico Calboli f.calboli at imperial.ac.uk
Wed Mar 23 18:33:47 CET 2005


On Wed, 2005-03-23 at 11:58 -0500, Shaw, Philip (NIH/NIMH) wrote:
> Hi
>  
> I am struggling with nested random effects and hope someone can help.
>  
> 
> 
> I have individuals (ID) who are nested within families (FAM).  I want to
> model an outcome variable, and take account of the intercorrelation of
> individuals within each family. 
>  
> I think this amounts to two random effects, one nested within the other.
>  
> How can I model this in R?
>  
> So far I have tried using the library(nlme), and then
>  
> Y~ID, random=~1|ID*FAM, 
>  

An interaction random effect/fixed effect is noted as 

random ~1|random/fixed

in your case random =~1|ID/FAM (but I don't uderstand why indiviuals
withing families are fixed and and families are random, but there you
go).

Check out Pinheiro and Bates Ch1, especially pg 23 onwards.

Cheers,

F 
-- 
Federico C. F. Calboli
Department of Epidemiology and Public Health
Imperial College, St Mary's Campus
Norfolk Place, London W2 1PG

Tel  +44 (0)20 7594 1602     Fax (+44) 020 7594 3193

f.calboli [.a.t] imperial.ac.uk
f.calboli [.a.t] gmail.com




More information about the R-help mailing list