Page 1 of 1

I have network data (alters nested in egos) but regression output is showing 3 levels

Posted: Sun Feb 17, 2019 1:27 am
by dcanarteg
Hello I am building a hierarchical logistic model using social network data in which 'EgoIdentifier" is level-2, and 'AlterIdentifier' is Level-1. Formula is below

############# Variance Component Model ########################
m1 <- logit(AltAnySupport) ~ 1 + (1 | EgoIdentifier) + (1 | AlterIdentifier)
(VarCompModel <- runMLwiN(Formula = m1, D = "Binomial", data = RomaAllData,
estoptions = list(EstM = 1)))

However, the regression output in the console is giving me 3 levels instead of 2???!!! See below.

The model formula:
logit(AltAnySupport) ~ 1 + (1 | EgoIdentifier) + (1 | AlterIdentifier)
Level 3: EgoIdentifier Level 2: AlterIdentifier Level 1: l1id

I am following Zhang et al. (2016) suggested in the formula 'F1 <- normexam ~ 1 + (1 | school) + (1 | student)' where 'school' is Level 2 and 'student is Level 1'. In my output, level 3 = EgoIdentifier (it should be level 2 instead), Level 2 = AlterIdentifier (it should be level 1) and 'Level 1: l1id' I have no idea where it came from. Moreover, on the output's header I can see only EgoIdentifier and AlterIdentifier with the correct number of observations respectively.

What can I do?
David

Re: I have network data (alters nested in egos) but regression output is showing 3 levels

Posted: Mon Feb 18, 2019 12:48 pm
by ChrisCharlton
As you can't make variables random at level-1 for discrete models R2MLwiN does not include this in the model specification (see http://www.bristol.ac.uk/cmm/media/r2ml ... CGuide10.R for example of setting up a binary model). When creating the input for MLwiN it will automatically create a level-1 identifier (l1id) and add this to the model, hence why this appears in your output. To fit the model that you are expecting you therefore just need to remove the + (1 | AlterIdentifier) from your specification.

Re: I have network data (alters nested in egos) but regression output is showing 3 levels

Posted: Mon Feb 18, 2019 2:41 pm
by dcanarteg
Thank you very much! I will try this asap