Dear Stata Users,
I need your help in creating local macros for all three variables in the given dataset.
For instance, a local macro i of the variable "overall" should display the following: 1"Diesel:49.01%" 2"Fuelwood and traditional biomass: 27.07%" 3"Electricity: 16.66%" .............................. 10"Kerosene: 0.00%"
Similarly, a local macro j of the variable "agri" should display: 1"Diesel:70.95%" 2"Fuelwood and traditional biomass: 22.61%" 3"Electricity: 5.11%" 4"LPG:1.09%" 5"Petrol:0.24" 6"Solar PV (Self-generated): 0.00%". Please note that there are missing values in "agri" so the numbering has to be done accordingly.
Here is the example dataset:
Thank you in advance!!
I need your help in creating local macros for all three variables in the given dataset.
For instance, a local macro i of the variable "overall" should display the following: 1"Diesel:49.01%" 2"Fuelwood and traditional biomass: 27.07%" 3"Electricity: 16.66%" .............................. 10"Kerosene: 0.00%"
Similarly, a local macro j of the variable "agri" should display: 1"Diesel:70.95%" 2"Fuelwood and traditional biomass: 22.61%" 3"Electricity: 5.11%" 4"LPG:1.09%" 5"Petrol:0.24" 6"Solar PV (Self-generated): 0.00%". Please note that there are missing values in "agri" so the numbering has to be done accordingly.
Here is the example dataset:
Code:
* Example generated by -dataex-. For more info, type help dataex clear input str40(overall agri manuf) "Diesel: 49.01%" "Diesel: 70.95%" "Diesel: 49.16%" "Fuelwood and traditional biomass: 27.07%" "Fuelwood and traditional biomass: 22.61%" "Fuelwood and traditional biomass: 28.97%" "Electricity: 16.66%" "Electricity: 5.11%" "Electricity: 15.32%" "Furnace-oil: 4.27%" "" "Furnace-oil: 4.63%" "Coal: 1.26%" "" "Coal: 1.37%" "LPG: 1.15%" "LPG: 1.09%" "LPG: 0.33%" "Petrol: 0.38%" "Petrol: 0.24%" "Petrol: 0.19%" "Solar PV (Self-generated): 0.19%" "Solar PV (Self-generated): 0.00%" "Solar PV (Self-generated): 0.03%" "Wind energy (self-generated): 0.00%" "" "Wind energy (self-generated): 0.01%" "Kerosene: 0.00%" "" "Kerosene: 0.00%" end
Thank you in advance!!
Comment