Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Prediction of future emissions per year by generatin multiple variables with loop

    input str12 ISIN int Year float(CO2EquivalentEmissionsOverall yearly_reduction)
    "AT000000STR1" 2023 1003842 37179.332
    "AT00000FACC2" 2023 7140 264.44446
    "AT0000609607" 2023 182495 6759.074
    "AT0000644505" 2023 1640000 60740.74

    My data set contains 500 companies defined by their ISIN Code and their reported CO2 emissions in 2023 as well as a calculated yearly reduction of those.

    I want to predict the future yearly emissions for every year starting in 2024 till 2050, generating a variable for each year with the precited emissions for each company in thta year. (Emissions_2024, Emissions_2025 and so on till Emissions_2050).

    I want to do this with a loop, so i dont have to generate a variable for each year. The predicted emissions are always the emissions in 2023 minus the yearly reduction times the number of years after 2023. So emissions_2024 = CO2EquivalentEmissionsOverall - (2024-2023)*yearly_reduction.

    Thanks for your help.
    Sebastian

  • #2
    Code:
    forvalues y = 2024/2050 {
        gen emissions_`y' = CO2EquivalentEmissionsOverall - (`y'-2023)*yearly_reduction
    }
    I am neither an economist nor an environmental engineer, but as an informed lay person I find a constant annual reduction exetrapolated over a long time horizon like this a rather unrealistic-looking model.

    Comment

    Working...
    X