Hi Statalist,
I need your help as I am stuck since a while. I would like to use -reghdfe- for my context, but I never used.
I'm currently working on a database of new vehicles registered in Spain. Here's a quick look at my current dataset. My dataset contains 1,340,682 observations:
In this database, we have several vehicle characteristics, such as fuel, cubic capacity of the engine, municipal code, whether the vehicle is a BEV, HEV, PHEV, conventional combustion, etc. and the price. The price has been merged with another database, according to some key characteristics (fuel, engine capacity, eletric vehicle or not, etc.).
I tried to regress this, but the values are small and wanted to know if this makes sense. Otherwise, I don't know how to get started with this. Could someone help me and tell me if I'm doing something wrong, please?
and the respective result:
Thank you VERY much in advance for your help. I'm really stuck.
Lovely day.
Michael
I need your help as I am stuck since a while. I would like to use -reghdfe- for my context, but I never used.
I'm currently working on a database of new vehicles registered in Spain. Here's a quick look at my current dataset. My dataset contains 1,340,682 observations:
Code:
* Example generated by -dataex-. For more info, type help dataex clear input str23 brand str60 model str4 fuel long(engine_cap muni_code) double power_kw int co2 float fiscal_power double price long ev_type_encoded "FORD" "FOCUS" "0" 999 29051 92 125 7.82 19088.88888888889 0 "FORD" "FOCUS" "0" 999 30016 92 108 7.82 19088.88888888889 0 "FORD" "FOCUS" "0" 999 15036 92 108 7.82 19088.88888888889 0 "FORD" "FOCUS" "0" 999 7040 92 108 7.82 19088.88888888889 0 "FORD" "FOCUS" "0" 999 8187 92 107 7.82 19088.88888888889 0 "FORD" "FOCUS" "0" 999 14060 92 107 7.82 19088.88888888889 0 end label values ev_type_encoded ev_type_encoded
I tried to regress this, but the values are small and wanted to know if this makes sense. Otherwise, I don't know how to get started with this. Could someone help me and tell me if I'm doing something wrong, please?
Code:
gen log_price = ln(price) reghdfe log_price engine_cap power_kw i.ev_type_encoded, absorb(model brand)
Code:
note: 1bn.ev_type_encoded is probably collinear with the fixed effects (all partialled-out values are close to zero; tol = 1.0e-09)
HDFE Linear regression Number of obs = 1,340,671
Absorbing 2 HDFE groups F( 3,1340315) = 242457.52
Prob > F = 0.0000
R-squared = 0.9437
Adj R-squared = 0.9436
Within R-sq. = 0.3518
Root MSE = 0.0867
---------------------------------------------------------------------------------
log_price | Coefficient Std. err. t P>|t| [95% conf. interval]
----------------+----------------------------------------------------------------
engine_cap | .0002434 4.48e-07 542.91 0.000 .0002425 .0002443
power_kw | .0037554 7.19e-06 522.19 0.000 .0037413 .0037695
|
ev_type_encoded |
BEV | 0 (omitted)
HEV | .023146 .0016264 14.23 0.000 .0199582 .0263337
|
_cons | 9.20634 .0008689 1.1e+04 0.000 9.204637 9.208043
---------------------------------------------------------------------------------
Absorbed degrees of freedom:
-----------------------------------------------------+
Absorbed FE | Categories - Redundant = Num. Coefs |
-------------+---------------------------------------|
model | 353 0 353 |
brand | 34 34 0 |
-----------------------------------------------------+
- Perhaps one more question: Is -reghdfe- the same as -xtreg-?
- Should I include the municipality code in the regression as a fixed effect? Basically I want to see the effect of a new policy that came into vigour in 2018, and requires anyone wishing to enter Madrid city centre by car to have either an electric car (BEV, FCEV) or a hybrid car (HEV, PHEV). It is the only place in Spain to have introduced such a measure.
Thank you VERY much in advance for your help. I'm really stuck.
Lovely day.
Michael

Comment