Hello community,
I am currently writing my thesis and am not very familiar with Stata or statistics. I have the following problem:
I am doing a difference-in-difference regression with fixed effects. I have data from an annual survey, but with different people each time. In year x, a nationwide tax was introduced, and I am analyzing the effects of this tax on different variables. This means that the tax affects all individuals surveyed in my survey. In order to determine the extent to which the tax had an effect, I have introduced a binary tax indicator ("SteuerJ") that increases to 1 from the time the tax was introduced. This means that the individuals in the years before the introduction of the tax are my control group and those in the year after are my treatment group, according to my professor.
In Stata, I first entered the command:
. xtset seriali year
Panel variable: seriali (weakly balanced)
Time variable: year, 2014 to 2019
Delta: 1 unit
Then this:
. xtreg SOFTDRINKSNOTLOWCALORIE SteuerJ i.year, fe
Stata then removes all variables because they are too highly correlated.
. xtreg SOFTDRINKSNOTLOWCALORIE SteuerJ i.year, fe
note: SteuerJ omitted because of collinearity.
note: 2015.year omitted because of collinearity.
note: 2016.year omitted because of collinearity.
note: 2017.year omitted because of collinearity.
note: 2018.year omitted because of collinearity.
note: 2019.year omitted because of collinearity.
Fixed-effects (within) regression Number of obs = 3,376
Group variable: seriali Number of groups = 3,376
However, the test shows this.
. corr SOFTDRINKSNOTLOWCALORIE SteuerJ year
(obs=3,376)
| S~NOTL~E SteuerJ year
-------------+---------------------------
S~NOTL~E | 1.0000
SteuerJ | -0.0759 1.0000
year | -0.0731 0.6555 1.0000
Are the commands even the right approach? What else do I need to consider to make it work? Many thanks in advance. If you need more information, please let me know.
I am currently writing my thesis and am not very familiar with Stata or statistics. I have the following problem:
I am doing a difference-in-difference regression with fixed effects. I have data from an annual survey, but with different people each time. In year x, a nationwide tax was introduced, and I am analyzing the effects of this tax on different variables. This means that the tax affects all individuals surveyed in my survey. In order to determine the extent to which the tax had an effect, I have introduced a binary tax indicator ("SteuerJ") that increases to 1 from the time the tax was introduced. This means that the individuals in the years before the introduction of the tax are my control group and those in the year after are my treatment group, according to my professor.
In Stata, I first entered the command:
. xtset seriali year
Panel variable: seriali (weakly balanced)
Time variable: year, 2014 to 2019
Delta: 1 unit
Then this:
. xtreg SOFTDRINKSNOTLOWCALORIE SteuerJ i.year, fe
Stata then removes all variables because they are too highly correlated.
. xtreg SOFTDRINKSNOTLOWCALORIE SteuerJ i.year, fe
note: SteuerJ omitted because of collinearity.
note: 2015.year omitted because of collinearity.
note: 2016.year omitted because of collinearity.
note: 2017.year omitted because of collinearity.
note: 2018.year omitted because of collinearity.
note: 2019.year omitted because of collinearity.
Fixed-effects (within) regression Number of obs = 3,376
Group variable: seriali Number of groups = 3,376
However, the test shows this.
. corr SOFTDRINKSNOTLOWCALORIE SteuerJ year
(obs=3,376)
| S~NOTL~E SteuerJ year
-------------+---------------------------
S~NOTL~E | 1.0000
SteuerJ | -0.0759 1.0000
year | -0.0731 0.6555 1.0000
Are the commands even the right approach? What else do I need to consider to make it work? Many thanks in advance. If you need more information, please let me know.
Comment