How to check hierarchy in complex cross-clasified structure

Welcome to the forum for R2MLwiN users. Feel free to post your question about R2MLwiN here. The Centre for Multilevel Modelling take no responsibility for the accuracy of these posts, we are unable to monitor them closely. Do go ahead and post your question and thank you in advance if you find the time to post any answers!

Go to R2MLwiN: Running MLwiN from within R >> http://www.bris.ac.uk/cmm/software/r2mlwin/
Post Reply
GerineLodder
Posts: 42
Joined: Thu Jul 28, 2016 11:33 am

How to check hierarchy in complex cross-clasified structure

Post by GerineLodder »

I have a dataset with the following levels:

School (99 schools)
Class * (see below)
ID (4249 children)
Time (3 timepoints, T1, T2, T3)

For Class, there is cross-nesting going on:
At T1, children were in their classT1 (N=250), At T2 and T3, children were in classT2 (N=232).

To be precise, we measured T1 in May, and both T2 and T3 were measured in the next schoolyear (October and May, respectively).
Classroom composition could change from T1 to T2, but because T2 and T3 were measured within the same school year, classroom composition was similar there.

I now defined this cross-classified structure as follow:

Code: Select all

 formula1 = outcome ~1 + (1|school) + (1|classT2) + (1|classT1) + (1|ID) + (1|Time)
My question is: can RMLwin tell that:
time is nested in ID,
ID is nested in both classT2 and classT1,
both classT2 and classT1 are nested in school ?

And, how can I chech that this hierarchy / clustering was recognized as it should?
billb
Posts: 157
Joined: Fri May 21, 2010 1:21 pm

Re: How to check hierarchy in complex cross-clasified structure

Post by billb »

Hi Gerine,
If you are using MCMC for your cross-classified model then the software doesn't need to know nestings as nested classifications are just a special case of the more general crossed classification. The only thing you have to be careful of is with regard how you label your units so things will go wrong for example if you reused in your example ID for different schools i.e. you might have a pupil 1 in school 1 and pupil 1 in school 2. If you choose cross-classification it would think these were the same pupil so ensure you have unique IDs.
Hope that helps,
Bill.
GerineLodder
Posts: 42
Joined: Thu Jul 28, 2016 11:33 am

Re: How to check hierarchy in complex cross-clasified structure

Post by GerineLodder »

That does help, thank you.

Just to be clear, the nesting of classrooms within schools, and nesting of ID in both classT1 and classT2, will be automatically recognized?
billb
Posts: 157
Joined: Fri May 21, 2010 1:21 pm

Re: How to check hierarchy in complex cross-clasified structure

Post by billb »

Hi Gesine,
The point is that they don't need to be recognized for the model to fit correctly - again you should have unique IDs so don't have classT1 = 1 in school 1 and classT1 = 1 in school 2 or they'll be treated as the same class. The MCMC algorithm unlike the IGLS algorithm doesn't rely on nestings to make it run.
Bill.
Post Reply