Hi,
I'm pretty new at stata programming and I am trying to figure something out. I have panel data with groups (US regions) across time (twenty years with monthly data) and a variable HDD, which is for every month for every region. I need a variable Wi for region i where its value is the weighted average (by region population, yearly) of HDD for all other regions (it does not include region i in weighted average). I was thinking of using collapse as the command, but I do not know the particular elements I have to compute (what variables, functions, etc.).
Thank you so much for any help, I am sure you know more than I do anyway.
Best wishes.
I'm pretty new at stata programming and I am trying to figure something out. I have panel data with groups (US regions) across time (twenty years with monthly data) and a variable HDD, which is for every month for every region. I need a variable Wi for region i where its value is the weighted average (by region population, yearly) of HDD for all other regions (it does not include region i in weighted average). I was thinking of using collapse as the command, but I do not know the particular elements I have to compute (what variables, functions, etc.).
Thank you so much for any help, I am sure you know more than I do anyway.
Best wishes.
Comment