Dear Statalist Users!
I'm woking on my bachelor thesis and doing a panel data analysis on children's wellbeing in connection with micro credit systems.
My data set is four rounds long and has 12079 observations total (the data examples are at the end of the post).
Now I was looking at a way to distinguish the treatment and control group, but I'm having some issues. The variable IKP is giving me the information if a family had access to the micro credit programm IKP since last round.
I'd like to construct my treatment in a way, that it can be distinguishable between rounds. So I can look at a treatment group which got treated only between round 2 and 3 (so IKP=1 in round 3) and another treatment group who only got treated between round 3 and 4 (so IKP=1 in round 4).
I did this with some help of other statalist members and it goes as follows:
(Switching the 4 with 3 in the first two lines should alter the treatment group for the above mentioned differentiation.)
Now my problem is that if I'm calculating how many people are in the microcredit system (at any point) and observed in round 4 I get 1683 observations, looking at how many of these only receive this treatment in period 4 with my constructed variable I get 4,552, which logically cannot be true.
Where is my mistake? I'm pretty sure the code above makes sense, but my results mustn't be correct.
Thanks so much for your help!
Best
Arto Arman
I'm woking on my bachelor thesis and doing a panel data analysis on children's wellbeing in connection with micro credit systems.
My data set is four rounds long and has 12079 observations total (the data examples are at the end of the post).
Now I was looking at a way to distinguish the treatment and control group, but I'm having some issues. The variable IKP is giving me the information if a family had access to the micro credit programm IKP since last round.
I'd like to construct my treatment in a way, that it can be distinguishable between rounds. So I can look at a treatment group which got treated only between round 2 and 3 (so IKP=1 in round 3) and another treatment group who only got treated between round 3 and 4 (so IKP=1 in round 4).
I did this with some help of other statalist members and it goes as follows:
(Switching the 4 with 3 in the first two lines should alter the treatment group for the above mentioned differentiation.)
Code:
by childid, sort: egen credit_period_4 = max(cond(round == 4, ikp, .)) by childid: egen credit_other_periods = min(cond(round != 4, ikp, .)) gen byte treatment = . replace treatment = 1 if credit_period_4 & !credit_other_periods replace treatment = 0 if !credit_period_4 & !credit_other_periods
Code:
tabulate ikp if round==4 hh | benefited | from ikp | programme | since last | round | Freq. Percent Cum. ------------+----------------------------------- no | 1,142 40.42 40.42 yes | 1,683 59.58 100.00 ------------+----------------------------------- Total | 2,825 100.00 tabulate treatment treatment | Freq. Percent Cum. ------------+----------------------------------- 0 | 3,844 45.78 45.78 1 | 4,552 54.22 100.00 ------------+----------------------------------- Total | 8,396
Thanks so much for your help!
Best
Arto Arman
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input byte childid 1 "IN010001" . 2 "IN010001" 0 3 "IN010001" 0 4 "IN010001" 0 1 "IN010002" . 2 "IN010002" 0 3 "IN010002" 0 4 "IN010002" 0 1 "IN010003" . 2 "IN010003" 0 3 "IN010003" 0 4 "IN010003" 1 1 "IN010004" . 2 "IN010004" 0 3 "IN010004" 0 4 "IN010004" 0 1 "IN010005" . 2 "IN010005" 0 3 "IN010005" 0 4 "IN010005" 0 1 "IN010006" . 2 "IN010006" 0 3 "IN010006" 0 4 "IN010006" . 1 "IN010007" . 2 "IN010007" 0 3 "IN010007" 0 4 "IN010007" 0 1 "IN010008" . 2 "IN010008" 1 3 "IN010008" 1 4 "IN010008" 1 1 "IN010009" . 2 "IN010009" 1 3 "IN010009" 0 4 "IN010009" 1 1 "IN010010" . 2 "IN010010" 0 3 "IN010010" 1 4 "IN010010" 0 1 "IN010011" . 2 "IN010011" 1 3 "IN010011" 0 4 "IN010011" 0 1 "IN010012" . 2 "IN010012" 0 3 "IN010012" 0 4 "IN010012" 0 1 "IN010013" . 2 "IN010013" 0 3 "IN010013" 0 4 "IN010013" 1 1 "IN010014" . 2 "IN010014" 1 3 "IN010014" 1 4 "IN010014" 1 1 "IN010015" . 2 "IN010015" 0 3 "IN010015" 0 4 "IN010015" 0 1 "IN010016" . 2 "IN010016" 0 3 "IN010016" 0 4 "IN010016" 1 1 "IN010017" . 2 "IN010017" 0 3 "IN010017" 0 4 "IN010017" 0 1 "IN010018" . 2 "IN010018" 0 3 "IN010018" 0 4 "IN010018" 0 1 "IN010019" . 2 "IN010019" 0 3 "IN010019" 0 4 "IN010019" 0 1 "IN010020" . 2 "IN010020" 0 3 "IN010020" 0 4 "IN010020" 0 1 "IN010021" . 2 "IN010021" 0 3 "IN010021" 0 4 "IN010021" 1 1 "IN010022" . 2 "IN010022" . 3 "IN010022" . 4 "IN010022" . 1 "IN010023" . 2 "IN010023" 0 3 "IN010023" 0 4 "IN010023" 1 1 "IN010024" . 2 "IN010024" 0 3 "IN010024" 0 4 "IN010024" 1 1 "IN010025" . 2 "IN010025" 0 3 "IN010025" 0 4 "IN010025" 0 end
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input byte ikp . 0 0 0 . 0 0 0 . 0 0 1 . 0 0 0 . 0 0 0 . 0 0 . . 0 0 0 . 1 1 1 . 1 0 1 . 0 1 0 . 1 0 0 . 0 0 0 . 0 0 1 . 1 1 1 . 0 0 0 . 0 0 1 . 0 0 0 . 0 0 0 . 0 0 0 . 0 0 0 . 0 0 1 . . . . . 0 0 1 . 0 0 1 . 0 0 0 end label values ikp ikp label def ikp 0 "no", modify label def ikp 1 "yes", modify
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input byte round 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 end
Comment