Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: strange -storecmd- behavior


From   [email protected] (Jean Marie Linhart, StataCorp LP)
To   [email protected]
Subject   Re: st: strange -storecmd- behavior
Date   Wed, 07 Dec 2005 17:05:15 -0600

Al Feiveson asked:

> Nick I was using -storecmd- to do -xtintreg- but I obtained slightly
> different results after the -storecmd- statement and then if I
> repeat the analysis with a straight command. For some reason, with
> "storecmd", the integration method used is "ghermite" (not the
> default), whereas with the straight command, it correctly uses the
> default "aghermite". But I never issued an option for "ghermite" so
> what's going on?

Nick Cox replied:

> I can't explain this, but I don't see that it's anything to do with
> -storecmd-. -storecmd- doesn't reach inside your command and change
> it. Nor can I think of side-effects that would cause this. Still,
> lack of imagination is not proof of absence.

I can explain what is going on.  -storecmd- sets -version 6.0- in its
code, so when it runs the -xtintreg- command, it is run as version 6.
Under version control, -xtintreg- properly reverts to the old method of
Gauss-Hermite quadrature which was used in versions prior to 9.

When Al Feiveson runs his code from the command line, he is using version
9, and he gets version 9 behavior.

We (at StataCorp) run into this sort of issue with version control
frequently (crack  the hood on -xtintreg- itself for example...) if Nick
wants to change  the behavior of -storecmd-, I'd suggest he change the
portion of his code that executes the command from: 

        * execute command
        `cmd'
        
to:

	* execute command
        local vv : di "version " string(_caller()) ", missing :"
        `vv' `cmd'

Hope that helps.

--Jean Marie
[email protected]
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index