Hi everyone,
I have to construct several transition matrices. This is a quite new topic for me, so I apologize if I write something wrong. The idea is the following:
Here a short description of the dataset variables:
Your help is really appreciated... and needed!
Thank you very much in advance.
Best wishes,
Michael
I have to construct several transition matrices. This is a quite new topic for me, so I apologize if I write something wrong. The idea is the following:
- Summarize all switches of contracts with a table that has each type of contract in the rows, and each type of contract in the columns. The matrix should give me the share of people that went from one contract to another when they change.
- Summarize all switches of contracts that change their contracted powers in period 1 only.
- I also want to the same thing, but with contract switches from a given contract into a contract when solar panels where installed (everything will be clearer below with a dataex).
- Finally, the idea is to save these matrices into tables that can be put into LaTeX please.
Code:
* Example generated by -dataex-. For more info, type help dataex clear input long(id sp_zipcode) double(date_contract_start date_contract_end) float kW_power_p1 str13 product_classification str5 tariff_ekon_id str19 fecha_operativa_pv long idcontrato float solar_dummy 12201 28971 21581 22431 6.9 "Sin Sorpresas" "20DHA" "" 307371 0 12201 28971 22432 22523 6.9 "Sin Sorpresas" "20TD" "" 1105958 0 12201 28971 22524 22645 6.9 "Sin Sorpresas" "20TD" "" 1403342 0 12201 28971 22646 22676 6.9 "Sin Sorpresas" "20TD" "" 1615598 0 12201 28971 22677 22735 6.9 "Sin Sorpresas" "20TD" "" 1894349 0 12201 28971 22736 23010 6.9 "Sin Sorpresas" "20TD" "" 2329184 0 12201 28971 23011 23069 6.9 "Sin Sorpresas" "20TD" "" 2951346 0 12201 28971 23070 . 6.9 "Tarifa Justa" "20TD" "" 3040052 0 12204 28440 19738 21608 6.6 "Sin Sorpresas" "20DHA" "2022-07-29 16:10:00" 12204 1 12204 28440 21609 21945 6.6 "Sin Sorpresas" "20DHA" "2022-07-29 16:10:00" 322750 1 12204 28440 21946 22431 6.6 "Sin Sorpresas" "20DHA" "2022-07-29 16:10:00" 615892 1 12204 28440 22432 22523 6.6 "Sin Sorpresas" "20TD" "2022-07-29 16:10:00" 1223037 1 end format %td date_contract_start format %td date_contract_end
- -id- is the household’s ID,
- -kW_power_p1- is the contracted power in kW for period 1,
- -product_classification- is the contract type,
- -tariff_ekon_id- is the tariff type,
- -fecha_operativa_pv- is the date of the starting of panel solar’s use,
- -idcontrato- is the Contract ID,
- -solar_dummy- is a 0/1 dummy variable. 1 stands for the inclusion of a solar panel in a contract.
Your help is really appreciated... and needed!
Thank you very much in advance.
Best wishes,
Michael
Comment