Dear Statalist,
I have uploaded version 2.0.0 of the user-written command xtpmg to SSC.
This update resolves a compatibility issue affecting the MG (Mean Group)
estimator when running under Stata 15.1 and later.
In the legacy 2007 implementation (Blackburne & Frank), the MG routine
fails with:
invalid new variable name
r(110);
The error is triggered by stricter validation rules introduced in Stata's
internal _predict command (20 Feb 2019 update). The original code used the
same name for both the output variable and the eq() equation reference,
which is no longer allowed.
Version 2.0.0 corrects this by predicting into a temporary variable and
then generating the requested EC variable, preserving the original
estimation logic while ensuring full compatibility with modern Stata
releases.
Additional improvements include:
• Minimum supported Stata version raised to 15.1
• Cleaner EC handling and improved option parsing
• Updated help file in SMCL format (SSC compliant)
• Improved error messages
• Version number displayed in estimation output
To install or update:
ssc install xtpmg, replace
.
I have uploaded version 2.0.0 of the user-written command xtpmg to SSC.
This update resolves a compatibility issue affecting the MG (Mean Group)
estimator when running under Stata 15.1 and later.
In the legacy 2007 implementation (Blackburne & Frank), the MG routine
fails with:
invalid new variable name
r(110);
The error is triggered by stricter validation rules introduced in Stata's
internal _predict command (20 Feb 2019 update). The original code used the
same name for both the output variable and the eq() equation reference,
which is no longer allowed.
Version 2.0.0 corrects this by predicting into a temporary variable and
then generating the requested EC variable, preserving the original
estimation logic while ensuring full compatibility with modern Stata
releases.
Additional improvements include:
• Minimum supported Stata version raised to 15.1
• Cleaner EC handling and improved option parsing
• Updated help file in SMCL format (SSC compliant)
• Improved error messages
• Version number displayed in estimation output
To install or update:
ssc install xtpmg, replace
.

Comment