Robust Standard Errors: Poisson Panel Regression (pglm, lmtest)











up vote
0
down vote

favorite












As a non-statistician I reached my limit here:



I try to fit a Poisson model for panel data (using pglm) and I want to calculate robust standard errors (using lmtest).



My code currently looks like this:



#poisson model (panel with year fixed effects):
poisson_model <- pglm(y ~ a + b + c + factor(year), data = regression_data,
model = "pooling", family = poisson, index = c("ID", "year"))

#robust standard errors:
robust_SE_model <- coeftest(poisson_model, vcov. = vcovHC(poisson_model, type = "HC1"))


This code works fine for one of my other model specifications when I fit a regular panel model with plm, but when I try the poisson model with pglm I receive the following error message:



Error in terms.default(object) : no terms component nor attribute


Is this due to a limitation of the lmtest package or am I making a mistake here? I really hope I can solve the problem using packages (not necessarily pglm and lmtest) and don't have to dive into manual calculation of robust errors.



Any help is highly appreciated!










share|improve this question


















  • 1




    As far as I can decipher from ?pglm, the library does not support sandwich error matrices. cran.r-project.org/web/packages/poisFErobust/index.html or cran.r-project.org/web/packages/glmmML might be useful.
    – Otto Kässi
    Nov 9 at 12:15












  • @OttoKässi Thanks, that was indeed the problem. The packages you mention will help me for sure. The whole robust errors for models which are non-linear in the parameters topic is a highly controversial one, which I was not completely aware of so far. So applying robust errors if there is heteroscedasticity does not cure any problems obviously: davegiles.blogspot.com/2013/05/…
    – sspade
    Nov 22 at 9:29

















up vote
0
down vote

favorite












As a non-statistician I reached my limit here:



I try to fit a Poisson model for panel data (using pglm) and I want to calculate robust standard errors (using lmtest).



My code currently looks like this:



#poisson model (panel with year fixed effects):
poisson_model <- pglm(y ~ a + b + c + factor(year), data = regression_data,
model = "pooling", family = poisson, index = c("ID", "year"))

#robust standard errors:
robust_SE_model <- coeftest(poisson_model, vcov. = vcovHC(poisson_model, type = "HC1"))


This code works fine for one of my other model specifications when I fit a regular panel model with plm, but when I try the poisson model with pglm I receive the following error message:



Error in terms.default(object) : no terms component nor attribute


Is this due to a limitation of the lmtest package or am I making a mistake here? I really hope I can solve the problem using packages (not necessarily pglm and lmtest) and don't have to dive into manual calculation of robust errors.



Any help is highly appreciated!










share|improve this question


















  • 1




    As far as I can decipher from ?pglm, the library does not support sandwich error matrices. cran.r-project.org/web/packages/poisFErobust/index.html or cran.r-project.org/web/packages/glmmML might be useful.
    – Otto Kässi
    Nov 9 at 12:15












  • @OttoKässi Thanks, that was indeed the problem. The packages you mention will help me for sure. The whole robust errors for models which are non-linear in the parameters topic is a highly controversial one, which I was not completely aware of so far. So applying robust errors if there is heteroscedasticity does not cure any problems obviously: davegiles.blogspot.com/2013/05/…
    – sspade
    Nov 22 at 9:29















up vote
0
down vote

favorite









up vote
0
down vote

favorite











As a non-statistician I reached my limit here:



I try to fit a Poisson model for panel data (using pglm) and I want to calculate robust standard errors (using lmtest).



My code currently looks like this:



#poisson model (panel with year fixed effects):
poisson_model <- pglm(y ~ a + b + c + factor(year), data = regression_data,
model = "pooling", family = poisson, index = c("ID", "year"))

#robust standard errors:
robust_SE_model <- coeftest(poisson_model, vcov. = vcovHC(poisson_model, type = "HC1"))


This code works fine for one of my other model specifications when I fit a regular panel model with plm, but when I try the poisson model with pglm I receive the following error message:



Error in terms.default(object) : no terms component nor attribute


Is this due to a limitation of the lmtest package or am I making a mistake here? I really hope I can solve the problem using packages (not necessarily pglm and lmtest) and don't have to dive into manual calculation of robust errors.



Any help is highly appreciated!










share|improve this question













As a non-statistician I reached my limit here:



I try to fit a Poisson model for panel data (using pglm) and I want to calculate robust standard errors (using lmtest).



My code currently looks like this:



#poisson model (panel with year fixed effects):
poisson_model <- pglm(y ~ a + b + c + factor(year), data = regression_data,
model = "pooling", family = poisson, index = c("ID", "year"))

#robust standard errors:
robust_SE_model <- coeftest(poisson_model, vcov. = vcovHC(poisson_model, type = "HC1"))


This code works fine for one of my other model specifications when I fit a regular panel model with plm, but when I try the poisson model with pglm I receive the following error message:



Error in terms.default(object) : no terms component nor attribute


Is this due to a limitation of the lmtest package or am I making a mistake here? I really hope I can solve the problem using packages (not necessarily pglm and lmtest) and don't have to dive into manual calculation of robust errors.



Any help is highly appreciated!







r panel poisson robust






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 9 at 10:53









sspade

213




213








  • 1




    As far as I can decipher from ?pglm, the library does not support sandwich error matrices. cran.r-project.org/web/packages/poisFErobust/index.html or cran.r-project.org/web/packages/glmmML might be useful.
    – Otto Kässi
    Nov 9 at 12:15












  • @OttoKässi Thanks, that was indeed the problem. The packages you mention will help me for sure. The whole robust errors for models which are non-linear in the parameters topic is a highly controversial one, which I was not completely aware of so far. So applying robust errors if there is heteroscedasticity does not cure any problems obviously: davegiles.blogspot.com/2013/05/…
    – sspade
    Nov 22 at 9:29
















  • 1




    As far as I can decipher from ?pglm, the library does not support sandwich error matrices. cran.r-project.org/web/packages/poisFErobust/index.html or cran.r-project.org/web/packages/glmmML might be useful.
    – Otto Kässi
    Nov 9 at 12:15












  • @OttoKässi Thanks, that was indeed the problem. The packages you mention will help me for sure. The whole robust errors for models which are non-linear in the parameters topic is a highly controversial one, which I was not completely aware of so far. So applying robust errors if there is heteroscedasticity does not cure any problems obviously: davegiles.blogspot.com/2013/05/…
    – sspade
    Nov 22 at 9:29










1




1




As far as I can decipher from ?pglm, the library does not support sandwich error matrices. cran.r-project.org/web/packages/poisFErobust/index.html or cran.r-project.org/web/packages/glmmML might be useful.
– Otto Kässi
Nov 9 at 12:15






As far as I can decipher from ?pglm, the library does not support sandwich error matrices. cran.r-project.org/web/packages/poisFErobust/index.html or cran.r-project.org/web/packages/glmmML might be useful.
– Otto Kässi
Nov 9 at 12:15














@OttoKässi Thanks, that was indeed the problem. The packages you mention will help me for sure. The whole robust errors for models which are non-linear in the parameters topic is a highly controversial one, which I was not completely aware of so far. So applying robust errors if there is heteroscedasticity does not cure any problems obviously: davegiles.blogspot.com/2013/05/…
– sspade
Nov 22 at 9:29






@OttoKässi Thanks, that was indeed the problem. The packages you mention will help me for sure. The whole robust errors for models which are non-linear in the parameters topic is a highly controversial one, which I was not completely aware of so far. So applying robust errors if there is heteroscedasticity does not cure any problems obviously: davegiles.blogspot.com/2013/05/…
– sspade
Nov 22 at 9:29



















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53224319%2frobust-standard-errors-poisson-panel-regression-pglm-lmtest%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















 

draft saved


draft discarded



















































 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53224319%2frobust-standard-errors-poisson-panel-regression-pglm-lmtest%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Schultheiß

Verwaltungsgliederung Dänemarks

Liste der Kulturdenkmale in Wilsdruff