Je veux faire un f-test à un modèle plm et test pourF-test avec plm modèle
model <- plm(y ~ a + b)
si
# a = b
et
# a = 0 and b = 0
I essayé linéaireHypothèse comme ceci
linearHypothesis(ur.model, c("a", "b")) to test for a = 0 and b = 0
mais a obtenu l'erreur
Error in constants(lhs, cnames_symb) :
The hypothesis "sgp1" is not well formed: contains bad coefficient/variable names.
Calls: linearHypothesis ... makeHypothesis -> rbind -> Recall -> makeHypothesis -> constants
In addition: Warning message:
In constants(lhs, cnames_symb) : NAs introduced by coercion
Execution halted
Mon exemple ci-dessus est avec le code qui est un peu simplifiée si le problème est facile. Si les problèmes sont dans les détails est le code réel ici.
model3 <- formula(balance.agr ~ sgp1 + sgp2 + cp + eu + election + gdpchange.imf + ue.ameco)
ur.model<-plm(model3, data=panel.l.fullsample, index=c("country","year"), model="within", effect="twoways")
linearHypothesis(ur.model, c("sgp1", "sgp2"), vcov.=vcovHC(plmmodel1, method="arellano", type = "HC1", clustering="group"))
Si vous fournissez votre propre code, assurez-vous d'avoir un jeu de données pour l'essayer. Veuillez fournir un exemple reproductible la prochaine fois. –