I have a dataset containing daily stock returns of the S&P constituents for 10 months in 2020 (01 Jan – 30 Oct), the index return and the changes in the election winning probabilities (delta_dem and delta_rep).
`date company r_company rm_spx delta_dem delta_rep
02.01.2020 AMAZON.COM 0,027150711 0,008502236 0,008130081 -0,01038961
03.01.2020 AMAZON.COM -0,012138924 -0,006955361 -0,008064516 0,010498688
06.01.2020 AMAZON.COM 0,014885454 0,003537844 -0,017133956 -0,002695418
07.01.2020 AMAZON.COM 0,002091731 -0,002702481 0,015847861 0,032432432
08.01.2020 AMAZON.COM -0,007808954 0,004933975 -0,031201248 -0,031413613
09.01.2020 AMAZON.COM 0,004799548 0,006921521 0,006441224 0,054054054
10.01.2020 AMAZON.COM -0,009410983 -0,002853988 0,008 -0,048717949
13.01.2020 AMAZON.COM 0,00432284 0,006979618 -0,020833333 0,037735849
I want to run a panel regression with both company and time-fixed effects using the effect: twoways function.
panel_model <- plm(r_company ~ rm_spx + delta_dem, data = panel_data, model = "within", effect = "twoways")
If I run this, I get the following error message on R:
Error in plm.fit(data, model, effect, random.method, random.models, random.dfcor, : empty model
I have already ruled out multicollinearity issues and my data is balanced, no missing values either (there is no data for weekends and public holidays but I have completely removed these days from my dataset)
The issue seems to lie within the time proportion as this regression gives me the same error:
fixed_model_time <- plm(r_company ~ rm_spx + delta_dem + factor(date), data = panel_data, model = "within", effect = "time")
Error in plm.fit(data, model, effect, random.method, random.models, random.dfcor, : empty model
How can I resolve this issue? I also ran a Hausman test but it did not work due to the abovementioned error.
user25405835 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.