1

I'm having a problem with with the pFtest() function from the plm package.

I'm using the following three tests (see code below). However, if you look at the output you will see that for the pFtest I get a p-value = NA. I guess this is due to the fact that df1 = 0 and F-value = -Inf but I don't know why this is the case. Can this happen normally or do I maybe have a problem with my data?

My dataset is quite big but and I used index=c("CountryName","Dates") in the plm commands and the regressions worked fine. I only had an issue with the random effects regression where I had to use random.method="nerlove" manually because the other methods didn't work. Dates are in date format and data is daily in case this matters.

Input code:

# LM Test for random effects vs OLS
plmtest(SevFX_Pooling_Stringency)
# F Test for fixed effects vs OLS
pFtest(SevFX_Within_Stringency,SevFX_Pooling_Stringency)
# Hausmann Test
phtest(SevFX_Random_Stringency, SevFX_Within_Stringency)

Output:

> # LM Test for random effects vs OLS
> plmtest(SevFX_Pooling_Stringency)

    Lagrange Multiplier Test - (Honda) for unbalanced panels

data:  StringencyIndex ~ gap_potgdp + CasesPerKPop + DeathsPerKPop +  CountryName
normal = -3.678, p-value = 0.9999
alternative hypothesis: significant effects

> # F Test for fixed effects vs OLS
> pFtest(SevFX_Within_Stringency,SevFX_Pooling_Stringency)

    F test for individual effects

data:  StringencyIndex ~ gap_potgdp + CasesPerKPop + DeathsPerKPop +  CountryName
F = -Inf, df1 = 0, df2 = 12982, p-value = NA
alternative hypothesis: significant effects

> # Hausmann Test
> phtest(SevFX_Random_Stringency, SevFX_Within_Stringency)

    Hausman Test

data:  StringencyIndex ~ gap_potgdp + CasesPerKPop + DeathsPerKPop +  CountryName
chisq = 2.9904e-11, df = 2, p-value = 1
alternative hypothesis: one model is inconsistent
Paul
  • 2,850
  • 1
  • 12
  • 37
Aschi
  • 11
  • 2
  • date format for the time index might be a problem. `df1` is calc. as `df.residual(pooling) - df.residual(within)` so you might want to check what `df.residual` returns for both of your models. Also, you might want to show the formula and command you used to estimate both models. – Helix123 Aug 11 '21 at 19:29
  • I transformed the dates to numeric form with `as.numeric`, but it gave the same result. I also checked the `df.residual` for both models as you mentioned. They both return the value of 12982 therefore `df1` is 0. – Aschi Aug 13 '21 at 10:31
  • The FE model should have a lower value for `df.residual` than the corresponding pooling model. Check that you really estimated a FE model (e.g., by looking at the output of `summary(SevFX_Within_Stringency)`. If that does not help, I guess we cannot help further without the estimation code and the data (or - even better - a reproducible example). – Helix123 Aug 13 '21 at 13:44
  • I think I found the issue. I added the variable "CountryName" which I used in the `index = c("CountryName", "Dates")` into the model as you can see in the Output Code from the post. So from my understanding this rendered the pooled OLS model basically useless since the cross-sectional data is already included. This can be completely wrong but as of now I don't know any better. I removed this variable and the `pFtest()`, `phtest()` and `plmtest()` work fine now. – Aschi Aug 14 '21 at 18:09
  • 1
    Thats solves it: you made your pooling model a LSDV model by including the fixed effects of the individual dimension explicitly as dummy variable which is equivalent to the fixed effects model and, thus, you compared the essentially the same models in pFtest. – Helix123 Aug 15 '21 at 18:44

0 Answers0