Page 1 of 1

Creating an indicator variable for egonets of size 1

Posted: Wed Nov 05, 2014 8:34 pm
by BramVanLeeuwen
Hi all,

I want to run a cross-classified multilevel logistic model with four levels (individual, school, area, and friendship network). The situation with regard to friendship networks is similar to that of families in Rasbash et al. (2010), i.e., most individuals in the sample are the only member of a particular ego-net (because of incomplete sampling). Rasbash et al. use an indicator variable Dj that indicates whether an individual is an only child (Dj = 0) or a member of a twin-pair (Dj = 1). I need to include an indicator variable that indicates whether an individual is the only member of an ego-net (Dj = 0) or one of two or more (Dj = 1). In the model the random effect (Ufriend) is then multiplied by the indicator variable.

My question: How do I include the indicator variable in my model code?

Many thanks,
Bram van Leeuwen




Rasbash, J., Leckie, G., Pillinger, R., & Jenkins, J. (2010). Children's educational progress: partitioning family, school and area effects. Journal of the Royal Statistical Society: Series A (Statistics in Society), 173(3), 657-682.

Re: Creating an indicator variable for egonets of size 1

Posted: Tue Nov 11, 2014 2:27 pm
by GeorgeLeckie
Hi Bram,

In Rasbash et al. (2010) we did something like the following:

Code: Select all

. runmlwin y cons x1 x2 x3, ///
    level4(area: cons) ///
    level3(school: cons) ///
    level2(family: twin) ///
    level1(child: singleton twin) ///
    mcmc(xc) nopause
where singleton is a binary indicator of one child families, while twin is a binary indicator of twin families. This leads to a single variance component for singleton families (the within and between variances cannot be decomposed) and two variance components for twin families (the within- and between- variance components can be decomposed).

I don't think this trick carries over to multilevel logistic regression as there you can't specify level-1 variance functions. There may be something else you can do, but it might take some thinking about.

Sorry not to be of more help.

George