Hello,
I'm attempting a DiD model for the following research question: "Effect of the Pandemic on CO2 emissions from Road Transport in India". I'm using daily emissions data for the sample period: 1st January 2019 to 30th April 2021. The CO2 emission variable is CO2gt and I have created a log version "ln_CO2gt".
The model is as follows:
I have created two dummy variables: Lockdown and Treatment. The var Lockdown has a value of 1 for the national lockdown imposed on 24th March 2020 to 31st May 2020 (and 0 otherwise). The var Treatment accounts for restrictions that were put in place before and after the lockdown. It has a value of 1 for the following dates: 1st March 2020 to 30th April 2021 (and 0 otherwise). I created a dummy variable for the interaction term (Lockdown * Treatment) called Interaction_term.
I do get results for
But, when I do
, Stata says the following:
note: 0b.Lockdown#0b.Treatment identifies no observations in the sample.
note: 1.Lockdown#1.Treatment omitted because of collinearity.
I've been trying for a while to resolve this and I haven't been able to. Request you to help me out. I don't know where the issue lies (I'm inexperienced with Stata). Any guidance will be greatly appreciated.
Thanks & Regards,
Shashwat Raut
MA Public Policy
P.S:
Here is an example of the data:
I have added a picture of the results as well:

Here is the model I'm replicating: https://doi.org/10.46557/001c.32623
I'm attempting a DiD model for the following research question: "Effect of the Pandemic on CO2 emissions from Road Transport in India". I'm using daily emissions data for the sample period: 1st January 2019 to 30th April 2021. The CO2 emission variable is CO2gt and I have created a log version "ln_CO2gt".
The model is as follows:
I have created two dummy variables: Lockdown and Treatment. The var Lockdown has a value of 1 for the national lockdown imposed on 24th March 2020 to 31st May 2020 (and 0 otherwise). The var Treatment accounts for restrictions that were put in place before and after the lockdown. It has a value of 1 for the following dates: 1st March 2020 to 30th April 2021 (and 0 otherwise). I created a dummy variable for the interaction term (Lockdown * Treatment) called Interaction_term.
I do get results for
Code:
reg ln_CO2gt Lockdown Treatment
Code:
reg ln_CO2gt i.Lockdown##i.Treatment
note: 0b.Lockdown#0b.Treatment identifies no observations in the sample.
note: 1.Lockdown#1.Treatment omitted because of collinearity.
I've been trying for a while to resolve this and I haven't been able to. Request you to help me out. I don't know where the issue lies (I'm inexperienced with Stata). Any guidance will be greatly appreciated.
Thanks & Regards,
Shashwat Raut
MA Public Policy
P.S:
Here is an example of the data:
Code:
* Example generated by -dataex-. For more info, type help dataex clear input str9 country int date str22 sector double CO2gt float(Lockdown Treatment ln_CO2gt Interaction_term) "India" 21550 "Ground Transport" .81621 1 0 -.2030836 0 "India" 21551 "Ground Transport" .834113 1 0 -.1813864 0 "India" 21552 "Ground Transport" .841574 1 0 -.17248133 0 "India" 21553 "Ground Transport" .842256 1 0 -.17167127 0 "India" 21554 "Ground Transport" .8345 1 0 -.18092254 0 "India" 21555 "Ground Transport" .783472 1 0 -.24401996 0 "India" 21556 "Ground Transport" .851924 1 0 -.16025797 0 "India" 21557 "Ground Transport" .849987 1 0 -.1625342 0 "India" 21558 "Ground Transport" .85244 1 0 -.15965246 0 "India" 21559 "Ground Transport" .852093 1 0 -.1600596 0 "India" 21560 "Ground Transport" .824344 1 0 -.19316736 0 "India" 21561 "Ground Transport" .801485 1 0 -.22128902 0 "India" 21562 "Ground Transport" .827079 1 0 -.18985507 0 "India" 21563 "Ground Transport" .845832 1 0 -.1674345 0 "India" 21564 "Ground Transport" .852258 1 0 -.15986598 0 "India" 21565 "Ground Transport" .862473 1 0 -.14795144 0 "India" 21566 "Ground Transport" .855752 1 0 -.15577467 0 "India" 21567 "Ground Transport" .860798 1 0 -.1498954 0 "India" 21568 "Ground Transport" .856241 1 0 -.1552034 0 "India" 21569 "Ground Transport" .813786 1 0 -.20605785 0 "India" 21570 "Ground Transport" .860982 1 0 -.1496817 0 "India" 21571 "Ground Transport" .863223 1 0 -.14708222 0 "India" 21572 "Ground Transport" .869637 1 0 -.1396794 0 "India" 21573 "Ground Transport" .862504 1 0 -.1479155 0 "India" 21574 "Ground Transport" .868498 1 0 -.14098999 0 "India" 21575 "Ground Transport" .762766 1 0 -.270804 0 "India" 21576 "Ground Transport" .812455 1 0 -.20769475 0 "India" 21577 "Ground Transport" .857439 1 0 -.15380524 0 "India" 21578 "Ground Transport" .861785 1 0 -.14874946 0 "India" 21579 "Ground Transport" .860553 1 0 -.15018007 0 "India" 21580 "Ground Transport" .857454 1 0 -.15378775 0 "India" 21581 "Ground Transport" .860215 1 0 -.15057293 0 "India" 21582 "Ground Transport" .854786 1 0 -.15690413 0 "India" 21583 "Ground Transport" .809818 1 0 -.21094576 0 "India" 21584 "Ground Transport" .85989 1 0 -.1509508 0 "India" 21585 "Ground Transport" .859365 1 0 -.15156153 0 "India" 21586 "Ground Transport" .863554 1 0 -.14669885 0 "India" 21587 "Ground Transport" .866625 1 0 -.14314893 0 "India" 21588 "Ground Transport" .867437 1 0 -.14221239 0 "India" 21589 "Ground Transport" .856717 1 0 -.15464763 0 "India" 21590 "Ground Transport" .814076 1 0 -.20570154 0 "India" 21591 "Ground Transport" .856122 1 0 -.1553424 0 "India" 21592 "Ground Transport" .856513 1 0 -.1548858 0 "India" 21593 "Ground Transport" .862477 1 0 -.14794679 0 "India" 21594 "Ground Transport" .864447 1 0 -.14566529 0 "India" 21595 "Ground Transport" .864512 1 0 -.1455901 0 "India" 21596 "Ground Transport" .848336 1 0 -.1644785 0 "India" 21597 "Ground Transport" .805526 1 0 -.2162598 0 "India" 21598 "Ground Transport" .853544 1 0 -.1583582 0 "India" 21599 "Ground Transport" .857997 1 0 -.15315467 0 "India" 21600 "Ground Transport" .848999 1 0 -.16369727 0 "India" 21601 "Ground Transport" .856793 1 0 -.15455893 0 "India" 21602 "Ground Transport" .860357 1 0 -.15040787 0 "India" 21603 "Ground Transport" .847557 1 0 -.1653972 0 "India" 21604 "Ground Transport" .789936 1 0 -.23580335 0 "India" 21605 "Ground Transport" .858492 1 0 -.1525779 0 "India" 21606 "Ground Transport" .853158 1 0 -.15881053 0 "India" 21607 "Ground Transport" .85647 1 0 -.154936 0 "India" 21608 "Ground Transport" .816053 1 0 -.203276 0 "India" 21609 "Ground Transport" .856556 1 0 -.1548356 0 "India" 21610 "Ground Transport" .853911 1 0 -.1579283 0 "India" 21611 "Ground Transport" .804152 1 0 -.21796697 0 "India" 21612 "Ground Transport" .82081 1 0 -.1974636 0 "India" 21613 "Ground Transport" .859263 1 0 -.15168023 0 "India" 21614 "Ground Transport" .861347 1 0 -.14925784 0 "India" 21615 "Ground Transport" .860789 1 0 -.14990588 0 "India" 21616 "Ground Transport" .863031 1 0 -.14730467 0 "India" 21617 "Ground Transport" .844829 1 0 -.16862103 0 "India" 21618 "Ground Transport" .795976 1 0 -.22818625 0 "India" 21619 "Ground Transport" .856549 1 0 -.15484375 0 "India" 21620 "Ground Transport" .857009 1 0 -.15430686 0 "India" 21621 "Ground Transport" .858947 1 0 -.15204805 0 "India" 21622 "Ground Transport" .858469 1 0 -.1526047 0 "India" 21623 "Ground Transport" .862287 1 0 -.14816712 0 "India" 21624 "Ground Transport" .854299 1 0 -.15747403 0 "India" 21625 "Ground Transport" .804889 1 0 -.2170509 0 "India" 21626 "Ground Transport" .85787 1 0 -.1533027 0 "India" 21627 "Ground Transport" .861115 1 0 -.1495272 0 "India" 21628 "Ground Transport" .837444 1 0 -.1774009 0 "India" 21629 "Ground Transport" .238581 1 0 -1.4330465 0 "India" 21630 "Ground Transport" .800987 1 0 -.22191057 0 "India" 21631 "Ground Transport" .82781 1 0 -.18897162 0 "India" 21632 "Ground Transport" .775076 1 0 -.25479418 0 "India" 21633 "Ground Transport" .854318 1 0 -.1574518 0 "India" 21634 "Ground Transport" .855706 1 0 -.1558284 0 "India" 21635 "Ground Transport" .856803 1 0 -.15454726 0 "India" 21636 "Ground Transport" .85508 1 0 -.15656024 0 "India" 21637 "Ground Transport" .85772 1 0 -.1534776 0 "India" 21638 "Ground Transport" .84991 1 0 -.1626248 0 "India" 21639 "Ground Transport" .813753 1 0 -.2060984 0 "India" 21640 "Ground Transport" .853824 1 0 -.1580302 0 "India" 21641 "Ground Transport" .84766 1 0 -.16527566 0 "India" 21642 "Ground Transport" .851417 1 0 -.16085325 0 "India" 21643 "Ground Transport" .850397 1 0 -.16205198 0 "India" 21644 "Ground Transport" .852294 1 0 -.15982375 0 "India" 21645 "Ground Transport" .823381 1 0 -.19433625 0 "India" 21646 "Ground Transport" .771547 1 0 -.2593577 0 "India" 21647 "Ground Transport" .850581 1 0 -.16183564 0 "India" 21648 "Ground Transport" .849756 1 0 -.16280603 0 "India" 21649 "Ground Transport" .850895 1 0 -.16146654 0 end format %tdNN/DD/CCYY date
I have added a picture of the results as well:
Here is the model I'm replicating: https://doi.org/10.46557/001c.32623
Comment