Skip to content

Conversation

@mronkko
Copy link

@mronkko mronkko commented Oct 11, 2025

Four very minor code changes that only apply to T=3 panels. Fixes #73

@tappek
Copy link
Collaborator

tappek commented Oct 12, 2025

Much appreciated, thank you for this! Will look at this more closely. I think a reproducible example for the fixes in pgmm is given by what you put in #73 while setting transformation = "ld":

library(multilevel)
library(plm)
data(univbct)

bliese_panel_data <- pdata.frame(univbct, index = c("SUBNUM", "TIME"))

est <- pgmm(
     JSAT ~
         plm::lag(JSAT) + plm::lag(COMMIT) + plm::lag(READY) | plm::lag(JSAT, 2),
     data = bliese_panel_data,
     effect = "individual", # Only individual fixed effects, no time effects
     model = "twostep",
     transformation = "ld"
)
summary(est)

@mronkko
Copy link
Author

mronkko commented Oct 12, 2025

Yes, that is a reproducible example. I was planning on writing a bug report, but then realized that this was easy to fix (just two lines of code) and submitted a pull request instead.

@mronkko
Copy link
Author

mronkko commented Oct 12, 2025

The code that you posted actually does not run with my patch because the summary functions fails for the ld model. The patch that I wrote addresses 1) Getting the ld model to estimate and 2) Getting the summary of d models to work when T=3. The logic for when to run mtests for ld models is not immediately obvious to me. The mtest is currently run as a part of summary for T=3 ld models even if calculating these tests is impossible.

@tappek
Copy link
Collaborator

tappek commented Nov 13, 2025

It seems like this changes some results, also for coefficients, in the test suite. Need to investigate more closely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Summary function of pgmm fails with T=3 data

2 participants