Hello
I want to find the causal effect of the number of new electric vehicles on the number of charging stations.
I use panel data, and want to use time fixed effects. Furthermore, I want to instrument the number of electric vehicles with the historic gasoline prices.
I want to use the xtivreg2 because this automatically produces the "Underidentification test -Kleibergen-Paap rk LM statistic", "Weak identification test (Kleibergen-Paap rk Wald F statistic)" and
"Hansen J statistic (overidentification test of all instruments)".
The code I run is:
tsset municipality month_num, delta(1)
xtset municipality month_num
xi: xtivreg2 ln_CStot (ln_EVsales = ln_gasprice1 ln_gasprice2 ln_gasprice3 ln_gasprice4 ln_gasprice5 ln_gasprice6), i(month_num) fe cluster(municipality)
When running this I get the following error message: "time and panel variables previously xtset -- may not be changed by options t() and i() -- use xtset to change them"
I attempted to move the i(month_num) to the left side of the comma, as such
xi: xtivreg2 ln_CStot (ln_EVsales = ln_gasprice1 ln_gasprice2 ln_gasprice3 ln_gasprice4 ln_gasprice5 ln_gasprice6) i.month_num, fe cluster(municipality)
However, this produces the following error: equation not identified; must have at least as many instruments not in the regression as there are instrumented variables
Hope someone can help
kind regards
Related Posts with xtivreg2 with time fixed effects
Combining/Merging Duplicate ObservationsHi all, I have a dataset containing over 300'000 observations and have identified a few (1'725) dupl…
Splitting up survival analyses by follow-up timeHi all, I have a dataset I am analysing using survival analyses, with multiple records per patient.…
reghdfe, clustering and crit. values -> adjusted?Dear all, I am using reghdfe and have few clusters. Throughout, I Wild-Cluster bottstrap my p-value…
Creating local (or global) macro of past date (or range), in DDNNCCYY formatHi, I am trying to save a date range as a macro. I have it working to a degree with: Code: su dat…
marginsplot after running a multinomial logit: how to plot the cumulative probabilities as an area graph Hello, I have been using the marginsplot function plot predicted probabilities after mlogit estimat…
Subscribe to:
Post Comments (Atom)
0 Response to xtivreg2 with time fixed effects
Post a Comment