Hi Statalist,
I would like to change the structure of my dataset, but I don't know how to proceed. Currently, my dataset looks as the following (let's call it Real Dataset):
Basically, I want to change this dataset into one at the "municipality level", in other terms something like:
We can define as a different project if the extraction's URL differs, for the same municipality.
The main municipality (the one that appears in -Municipalities- should be the variable -Municipality_1- for each line in our Real Dataset. We then include the other municipalities participating in the project in Others_Municipalities_Involved.
I hope it's clear what I want to achieve. Any suggestions you have for improvement are welcome!
Thank you in advance for your help. I'm really stuck and don't really know if what I'm doing is really feasible.
Best,
Michael
I would like to change the structure of my dataset, but I don't know how to proceed. Currently, my dataset looks as the following (let's call it Real Dataset):
Code:
* Example generated by -dataex-. For more info, type help dataex clear input str4 URL2 double Power_MW int Submission_Year long(cod_Municipality_1 cod_Municipality_2) "https://www.boe.es/diario_boe/txt.php?id=BOE-A-2017-4860" 20 16770 25 10 "https://www.boe.es/diario_boe/txt.php?id=BOE-A-2017-4859" 9.9 16958 25 10 "https://www.boe.es/diario_boe/txt.php?id=BOE-A-2017-4858" 9.9 16964 25 10 "https://www.boe.es/diario_boe/txt.php?id=BOE-A-2018-14107" 120 19318 8 5 "https://www.boe.es/diario_boe/txt.php?id=BOE-A-2018-14108" 74 19318 8 21 end format %tdnn/dd/CCYY Submission_Year label values cod_Municipality_1 cod_Municipality_1 label def cod_Municipality_1 8 "Calzadilla de los Barros", modify label def cod_Municipality_1 25 "La Puebla de Arganzón", modify label values cod_Municipality_2 cod_Municipality_2 label def cod_Municipality_2 5 "Bienvenida", modify label def cod_Municipality_2 10 "Condado de Treviño", modify label def cod_Municipality_2 21 "Medina de las Torres", modify
Municipalities | Project_1 | Project_2 | Project_3 | ... | Cumul_Pro | Power_MW_Pro1 | Power_MW_Pro2 | Power_MW_Pro3 | ... | Cumul_Power_MW_Pro | Others_Municipalities_Involved |
Calzadilla de los Barros | First Submission_Year appearing, in chronological way | Second Submission_Year, if any, in chronological way | Third Submission_Year, if any, in chronological way | 3 (the cumulative count of the three projects, if three), etc. | The Power in Mega Watts of Project 1 | The power in Mega Watts of Project 2, if this municipality has a second project | The power in Mega Watts of Project 3, if this municipality has a third project, etc. | The cumulative power in Mega Watts of the projects installed in this municipality | The count of the number of municipalities involved, appart the one listed in Municipalities | ||
The main municipality (the one that appears in -Municipalities- should be the variable -Municipality_1- for each line in our Real Dataset. We then include the other municipalities participating in the project in Others_Municipalities_Involved.
I hope it's clear what I want to achieve. Any suggestions you have for improvement are welcome!
Thank you in advance for your help. I'm really stuck and don't really know if what I'm doing is really feasible.
Best,
Michael
Comment