Hi all,
For my master thesis I am working with dynamic panel data with small T (13) and large N(20.000). I am estimating the long-term price elasticity of energy consumption using the Arellano-Bond estimator in xtabond2.
What I want to research is whether there is heteroscedasticity with respect to these elasticities and to do this I want to randomly take a sample from my dataset, run the regression, calculate the long-term elasticitiy, store it somewhere(?) and repeat this several (100+) times.
I then want to further inspect the datasets that resulted in the maximum and minimum with respect to the elasticity. I tried the following code
Indeed, three regressions are run, however they seem to be identical so I guess something must be wrong with how I set up the seed?
Also, I cannot seem to find how to inspect the values for the elasticities that I stored as a matrix? Should I store the results differently.
Any help is welcome!
Kind regards,
Hein Willems
For my master thesis I am working with dynamic panel data with small T (13) and large N(20.000). I am estimating the long-term price elasticity of energy consumption using the Arellano-Bond estimator in xtabond2.
What I want to research is whether there is heteroscedasticity with respect to these elasticities and to do this I want to randomly take a sample from my dataset, run the regression, calculate the long-term elasticitiy, store it somewhere(?) and repeat this several (100+) times.
I then want to further inspect the datasets that resulted in the maximum and minimum with respect to the elasticity. I tried the following code
Code:
forval i = 1/3 { set seed `i' tempfile holding save `holding' keep id duplicates drop sample 200, count merge 1:m id using `holding', assert (match using) keep(match) nogenerate sort id year xtabond2 consumption consumptionL1 consumptionL2 gas gasL1 gasL2 gdp gdpL1 gdpL2 heatdays, gmm(consumptionL1) iv(gas gasL1 gasL2 gdp gdpL1 gdpL2 heatdays) nolevel robust small matrix elast = (_b[gas] + _b[gasL1] + _b[gasL2])/(1-_b[consumptionL1] - _b[consumptionL2]) }
Also, I cannot seem to find how to inspect the values for the elasticities that I stored as a matrix? Should I store the results differently.
Any help is welcome!
Kind regards,
Hein Willems
Comment