Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problem with summary.pgmm #23

Closed
calebepiacentini opened this issue May 16, 2022 · 1 comment
Closed

problem with summary.pgmm #23

calebepiacentini opened this issue May 16, 2022 · 1 comment
Labels
bug Something isn't working
Milestone

Comments

@calebepiacentini
Copy link

When trying to summarise results from a pgmm object there is the following error message:
Error in t(y) %*% x : non-conformable arguments

Same problem is reported at:
https://stackoverflow.com/questions/10138633/pgmm-from-plm-package-gives-error-for-summary

It only happens when T<5. The problem seems to be that summary is calculating the mtest() autocorrelation test function for orders T=1 and T=2, which is not possible whenever T=3 and T=4 (since it does both, it is only possible to get a summary for T>=5).

Solution provided in the link results in yet another error:
Error in printCoefmat(x$coefficients, digits = digits) :
'x' must be coefficient matrix/data frame

Which problably is due to the coefficients attribute of a pgmm object being a list, resulting in error in the the function printCoefmat(). However, including some kind of if statement in the summary function for pgmm may solve the issue.

@tappek tappek changed the title problem with summary problem with summary.pgmm May 18, 2022
@tappek tappek added this to the next release milestone May 18, 2022
@tappek tappek added the bug Something isn't working label May 18, 2022
tappek added a commit that referenced this issue May 18, 2022
@tappek
Copy link
Collaborator

tappek commented May 18, 2022

Thank you for pointing to this! The author of the answer on stackoverflow did not adjust print.summary.pgmm to cater for the modified summary.pgmm and I think that is where you get the second error from.

The development version now contains an adjustment for this (and in the same vain for mtest to error gracefully in case the order is larger than or equal to available observations).

You can install the development version via

# install.packages("remotes") # remove '#' if pkg 'remotes' is not installed
remotes::install_github("ycroissant/plm")

@tappek tappek closed this as completed May 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants