problems running a specific model

Welcome to the forum for runmlwin users. Feel free to post your question about runmlwin 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 runmlwin: Running MLwiN from within Stata >> http://www.bristol.ac.uk/cmm/software/runmlwin/
Post Reply
simonplanells
Posts: 1
Joined: Sat Nov 17, 2012 11:53 am

problems running a specific model

Post by simonplanells »

Hi everyone,

I am trying to estimate the following model: 2 levels. 1=individuals, 2= neighborhoods

fear(ij])=a(j) +b(1j)var1(ij)+b(2)var2(ij)+e(ij)

a(j)=a(1) + u(0j) + var3(j) + var4(j) ---------------------> var3 and var4 are explanatory variables for the neighborhood level. But they do not related straigh to fear
b(1j)= b(1) + u(1j) + var5(ij) -------------------------> this is the random coefficinet. For instance, the effect of var1 varies across neighborhoods and is explained by var5.


could anyone help me and explain how to estimate the above model. I have tried gllamm but it does not work, takes too much time. I have tried runmlwin but I do not understand how to estimate the model.

PD: fear is a ordinal data which goes from 0 to 10.
GeorgeLeckie
Site Admin
Posts: 432
Joined: Fri Apr 01, 2011 2:14 pm

Re: problems running a specific model

Post by GeorgeLeckie »

Hi Simon,

The model you appear to want to estimate (note that I have made some corrections) is the following:

y_ij = b0_j + b1_j*x1_ij + b2*x2_ij + b3*x5_ij*x1_ij + e_ij
b0_j = b0 + b4*x3_j + b5*x4_j + u0_j
b1_j = b1 + u1_j

You have written this model using a two-stage formulation. The first equation is the level-1 model. The second and third equations are referred to as the level-2 sub-models.

However, the runmlwin, xtmixed and gllamm commands all use a mixed-effects formulation of the model.

The mixed-effects formulation of your model is obtained by substituting the second and third equations into the first equation above and rearranging

y_ij = b0 + b1*x1_ij + b2*x2_ij + b3*x5_ij*x1_ij + b4*x3_j + b5*x4_j
+ u0_j + u1_j*x1_ij
+ e_ij

where the RHS of the first line of the equation is referred to as the fixed part of the model. The second line is referred to as the random part of the model at level-2. THe third line of the model is referred to as the random part of the model at level-1.

You then specify the model as

Code: Select all

gen cons = 1

gen x5x1 = x5*x1

runmlwin y cons x1 x2 x5x1 x3 x4, ///
    level2(neighid: cons x1) ///
    level1(indid: cons) ///
    nopause
where the variable cons is simply the vector of ones variable associated with the intercept.

Best wishes

George
Post Reply