ich für einen f-Test zu einem plm-Modell und Test machen willF-Test mit plm-Modell
model <- plm(y ~ a + b)
wenn
# a = b
und
# a = 0 and b = 0
I versuchte linearHypothesis wie dieses
linearHypothesis(ur.model, c("a", "b")) to test for a = 0 and b = 0
bekam aber den Fehler
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
Mein Beispiel ist oben mit Code, der ein wenig vereinfacht, wenn das Problem einfach ist. Wenn das Problem in den Details liegt, ist der eigentliche Code hier.
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"))
Wenn Sie Ihren eigenen Code bereitstellen, stellen Sie sicher, dass wir über ein Dataset verfügen, um es zu testen. Bitte geben Sie beim nächsten Mal ein reproduzierbares Beispiel an. –