Dear Statalist members,
I hope some of you can explain to me what happens in my model. I have students nested in school. School is nested within municipalities. I have students' characteristics (fem, first_immigration, second_generation, education_father, education_mother). I created also some variables at school level (Level 2) like: I want to know the % of females in each school. I wrote
When the variable is dummy, I used "sum" while when the variable is not dummy but I have 1,2,3,4 for example, I used "count" like
[CODE] egen n_fem= sum (fem), by(school) ge perc_fem = (n_fem / num_student_total)*100 [\CODE]
I did the same to create some variables at municipality level (Level 3). To see the % of educated parents in a municipality, % of immigrants first generation and so on.
Then I run the following code:
[CODE] mixed students_score fem first_generation, second_generation, education_father education_mother ///
centre south || municipality: perc_females perc_educated_father perc_educated_mother || school: perc_females perc_educated_father_municipality , mle [\CODE]
Dependent variable is "student score". If I run the null model, everything is ok. I run the first model with only students' characteristics and nothing for level 3 (municipality) and nothing in level 2 (school) and everything is ok.
However, when I run the model with covariates at school and municipality levels, my model does not converge. Iteractions are endless and I got close to them "not concave"
I have no missing values but I do not understand why the model does not converge and I do not get results I would like to read.
I would like to understand with your help where I made the mistake.
I look forward to hearing from you.
Thank you
Simona
I hope some of you can explain to me what happens in my model. I have students nested in school. School is nested within municipalities. I have students' characteristics (fem, first_immigration, second_generation, education_father, education_mother). I created also some variables at school level (Level 2) like: I want to know the % of females in each school. I wrote
When the variable is dummy, I used "sum" while when the variable is not dummy but I have 1,2,3,4 for example, I used "count" like
[CODE] egen n_fem= sum (fem), by(school) ge perc_fem = (n_fem / num_student_total)*100 [\CODE]
I did the same to create some variables at municipality level (Level 3). To see the % of educated parents in a municipality, % of immigrants first generation and so on.
Then I run the following code:
[CODE] mixed students_score fem first_generation, second_generation, education_father education_mother ///
centre south || municipality: perc_females perc_educated_father perc_educated_mother || school: perc_females perc_educated_father_municipality , mle [\CODE]
Dependent variable is "student score". If I run the null model, everything is ok. I run the first model with only students' characteristics and nothing for level 3 (municipality) and nothing in level 2 (school) and everything is ok.
However, when I run the model with covariates at school and municipality levels, my model does not converge. Iteractions are endless and I got close to them "not concave"
I have no missing values but I do not understand why the model does not converge and I do not get results I would like to read.
I would like to understand with your help where I made the mistake.
I look forward to hearing from you.
Thank you
Simona
Comment