Hello everyone,

My data set contains 63 teachers (i) from 20 schools in a panel data format with T=4 (wave). But the data is strongly unbalanced.

xtset IDprof ano, yearly // IDprof = ID Teacher & ano = year
panel variable: IDprof (unbalanced)
time variable: ano, 2005 to 2008, but with gaps
delta: 1 year

tab IDprof ano, missing nolabel

group(nome | ano
_pro) | 2005 2006 2007 2008 | Total
-----------+--------------------------------------------+----------
53 | 0 1 0 1 | 2
77 | 0 1 0 1 | 2
87 | 1 1 1 0 | 3
104 | 1 1 0 0 | 2
125 | 0 1 1 0 | 2
166 | 0 1 1 1 | 3
170 | 0 0 1 1 | 2
200 | 1 1 0 0 | 2
217 | 0 1 0 1 | 2
232 | 0 1 1 0 | 2
248 | 0 0 1 1 | 2
276 | 1 1 0 0 | 2
316 | 0 1 1 0 | 2
322 | 0 1 1 0 | 2
329 | 0 0 1 1 | 2
334 | 0 1 1 0 | 2
347 | 1 0 0 1 | 2
352 | 0 0 1 1 | 2
356 | 1 0 0 1 | 2
360 | 1 1 0 0 | 2
371 | 0 0 1 1 | 2
390 | 0 0 1 1 | 2
403 | 0 1 1 0 | 2
427 | 0 0 1 1 | 2
429 | 0 0 1 1 | 2
434 | 0 0 1 1 | 2
455 | 1 0 1 1 | 3
508 | 0 1 0 1 | 2
528 | 1 0 1 0 | 2
563 | 1 0 0 1 | 2
-----------+--------------------------------------------+----------
Total | 10 16 19 18 | 63

For each teacher, I have a list of dependent variables related to teaching practices (q010 q012 q013) and a list of explanatory variables related to the school and student characteristics (q111 q100 q110) over the time period.
I create a DiD to investigate whether the intervention in 2008 generated some impact on the teacher practices.

generate time2 = (ano==2008) & !missing(ano) // Creating DiD: Treatment started in 2008.
I am using the command oprobit because q010 q012 q013 are Ordered Categorical Dependent Variables ranging between 1 and 5.
oprobit q010 time2 q111 q100 q110, cluster(IDescola)

My question is quite obvious and simple, but I don't get it.
In my DiD I want to use only the IDprof with (at least) two records over time AND one of them must be in 2008. In the example above I would use then the IDprof 53, 77, 166, 170, 217 and so on.


HERE ARE THE DATA
Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input int ano float time2 long IDescola float IDprof byte(q010 q012 q013 q111 q100 q110)
2006 0 35905446  53  5 5 5  2 4  4
2008 1 35905446  53  5 5 5  2 4  4
2006 0 35018387  77  2 5 4  2 4  3
2008 1 35018387  77  4 5 4  2 4  4
2005 0 35018348  87  5 5 4  2 5  4
2006 0 35018348  87  5 5 4  2 2  4
2007 0 35018348  87  4 4 3  2 4  4
2005 0 35018824 104  5 4 5  2 2  4
2006 0 35018512 104  5 4 4  2 2  4
2006 0 35913005 125  5 4 4  2 4  3
2007 0 35913005 125  1 2 2  2 4  4
2006 0 35018512 166  5 5 5  2 5  4
2007 0 35018512 166  5 5 5  2 5  4
2008 1 35018512 166  5 5 5  2 5  4
2007 0 35905446 170  4 4 4  2 2  3
2008 1 35905446 170  4 5 5  2 4  3
2005 0 35018107 200  4 4 3  2 4  4
2006 0 35018107 200  5 4 4  2 4  4
2006 0 35905446 217  5 5 5  2 4  4
2008 1 35905446 217  5 5 5  2 4  4
2006 0 35018348 232  5 4 3  2 5  3
2007 0 35018348 232 .a 4 3  2 5  3
2007 0 35901124 248  4 4 3 .a 4 .a
2008 1 35901124 248  2 5 5  2 4  4
2005 0 35018348 276  4 5 5  2 4  4
end
format %ty ano
label values IDprof IDprof
label def IDprof 53 "ANTONIA FERNANDA APARECIDA MIGUEL", modify
label def IDprof 77 "CELIA FEITOSA DOS SANTOS NICETTO", modify
label def IDprof 87 "CLAUDIA R T BUENO DE AGUIAR", modify
label def IDprof 104 "DALVA MAGRO DA SILVA", modify
label def IDprof 125 "DORACI GREGORIO SATELOS DIAS", modify
label def IDprof 166 "ESTER NOGUEIRA REGGIO", modify
label def IDprof 170 "EVA APARECIDA BATISTA", modify
label def IDprof 200 "HELOISA HELENA ZANATA BULGAREL", modify
label def IDprof 217 "IVONI DE FATIMA DE ARAUJO MARTINS", modify
label def IDprof 232 "KATIA GUIMARAES", modify
label def IDprof 248 "LEONICE FRANCISCA DE CARVALHO", modify
label def IDprof 276 "MARACI AP DE ABREU FERNANDES", modify
label values q010 q001
label values q012 q001
label values q013 q001
label def q001 1 "Nível 1 (discordo totalmente)", modify
label def q001 2 "Nível 2", modify
label def q001 4 "Nível 4", modify
label def q001 5 "Nível 5 (concordo totalmente)", modify
label def q001 .a "[9]Respostas inválidas", modify
label def q001 3 "Nível 3", modify
label values q111 q111
label def q111 2 "Feminino", modify
label values q100 q100
label def q100 2 "Ensino Médio - Magistério", modify
label def q100 4 "Ensino Superior - Pedagogia", modify
label def q100 5 "Ensino Superior - Licenciatura", modify
label values q110 q110
label def q110 3 "De 30 a 39 anos", modify
label def q110 4 "De 40 a 49 anos", modify
label def q110 .a "[9]Respostas inválidas", modify

Any advice would be highly appreciated!