Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: st: RE: RE: RE: RE: error messages while using the stgest command

From   "Nick Cox" <>
To   <>
Subject   RE: st: RE: RE: RE: RE: error messages while using the stgest command
Date   Fri, 4 Jun 2010 17:07:51 +0100

Yes, that's my guess. 

If it gets as far as the -graph- command then the local macro options is
discovered at that point, and only then, to contain junk that Stata
can't make sense of. 

It's my impression that in this sense Stata has not changed for some
while. Any parsing that leaves a residuum of buggy material in some
local macro will not bite unless and until that macro is scrutinised. 

Here's a demo: 

Here's a program: 

program martin
	syntax [, * ] 
	sysuse auto, clear
	regress mpg weight 

Here I run it: 

. martin, complete and utter nonsense

(1978 Automobile Data)

      Source |       SS       df       MS              Number of obs =
-------------+------------------------------           F(  1,    72) =
       Model |   1591.9902     1   1591.9902           Prob > F      =
    Residual |  851.469256    72  11.8259619           R-squared     =
-------------+------------------------------           Adj R-squared =
       Total |  2443.45946    73  33.4720474           Root MSE      =

         mpg |      Coef.   Std. Err.      t    P>|t|     [95% Conf.
      weight |  -.0060087   .0005179   -11.60   0.000    -.0070411
       _cons |   39.44028   1.614003    24.44   0.000     36.22283

What happened: 

1. I typed as if they were options "complete and utter nonsense". 

2. A consequence of the -syntax- statement is that a local macro options
is created with contents "complete and utter nonsense". 

3. My program never actually used `options'. Thus my program never bit
me, and Stata never complained, even though I typed (you guessed) some
nonsense on the command line. 


Martin Weiss

So, given your experience of Stata 7, Nick: Did the misplaced
somehow end up in the -options- for the -graph- command? The error
initially reported by Victor in would seem
indicate this sequence of events.

Nick Cox

The first error now seems pretty clear.  

The parenthesis ( before lasttime(endfudate) is what is causing the
error. Delete it. 

(You are probably misreading the syntax diagram within which the square
brackets [ ] group together optional options and are not characters to
be typed.)  

Victor Mauricio Herrera

Regarding the first error, I included no graph options in my
instructions. This is exactly what I typed:

stgest diabetes cursmoke agebase sex hyperten obese, lagconf(hyperten
obese diabetes) baseconf(hyperten obese diabetes) /*
*/ visit(visit) firstvis(2) (lasttime(endfudate) range(-50 50) step(1)
saveres(caergestsmoknocens) replace

I tried with two different datasets and got the same error.

*   For searches and help try:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index