Hi everyone,
I have a panel data of households, with the start and the end of their electricity contracts.
I would like to keep only observations for ids that install solar panels at a point in time (so that switch from 0 to 1 at any moment for my solar_dummy variable).
Imagine initially that a household doesn't own a solar panel on, say, December 1, 2021, and decides to install it later, on, say, April 5, 2023. I'd like to keep these households, please.
On the other hand, I don't want to keep those who have had a solar panel since the beginning, or who have never installed one, please.
Then, I would like to construct a transition matrix and observe if their electricity tariffs change (tariff_ekon_id_encod).
Thank you very much in advance.
Michael
I have a panel data of households, with the start and the end of their electricity contracts.
I would like to keep only observations for ids that install solar panels at a point in time (so that switch from 0 to 1 at any moment for my solar_dummy variable).
Imagine initially that a household doesn't own a solar panel on, say, December 1, 2021, and decides to install it later, on, say, April 5, 2023. I'd like to keep these households, please.
On the other hand, I don't want to keep those who have had a solar panel since the beginning, or who have never installed one, please.
Then, I would like to construct a transition matrix and observe if their electricity tariffs change (tariff_ekon_id_encod).
- Could anyone give me a hand with that, please?
Code:
* Example generated by -dataex-. For more info, type help dataex clear input long id double date_contract_start long tariff_ekon_id_encod float solar_dummy 1001 18887 1 0 1001 21701 2 0 1001 22432 4 0 1001 22646 4 0 1001 22677 4 0 1001 22736 4 0 1001 23011 4 0 1001 23070 4 0 1005 18800 1 0 1005 21640 1 0 end format %td date_contract_start label values tariff_ekon_id_encod tariff_ekon_id_encod label def tariff_ekon_id_encod 1 "20A", modify label def tariff_ekon_id_encod 2 "20DHA", modify label def tariff_ekon_id_encod 4 "20TD", modify
Michael
Comment