Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


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

st: RE: RE: polynomial distributed lag models error message


From   Nick Cox <n.j.cox@durham.ac.uk>
To   "'statalist@hsphsun2.harvard.edu'" <statalist@hsphsun2.harvard.edu>
Subject   st: RE: RE: polynomial distributed lag models error message
Date   Wed, 27 Oct 2010 21:23:15 +0100

I don't have that baton. It's still in mid-air. 

Nick 
n.j.cox@durham.ac.uk 


-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Steve Rothenberg
Sent: 27 October 2010 21:19
To: statalist@hsphsun2.harvard.edu
Subject: st: RE: polynomial distributed lag models error message

That did it!  Thanks also for the -asciiplot- tip, I had forgotten all about
it. Your joke lightened the mood around here too.

For anyone following this thread, suggestions about questions 2-4 from the
originating post would be most welcome.

Steve Rothenberg

>This is just the same problem. 

>First off, those are not double quotes. Those are nested single quotes.
Stata certainly has an idea of double >quotes but they are single key
characters, as in "Stata is beautifully simple and logical, despite any and
all appearances to the contrary".  

The left and right quotes must be distinctive for local macro references in
Stata. 

If the syntax were otherwise, Stata would have no way of disambiguating e.g.
'a'c'd'. 
Is that local macro a followed by plain c followed by local macro d or is it
a reference to local macro c embedded within other stuff? (NB this is _not_
Stata syntax.) 

Your left and right quotes are identical and Stata thus has no idea what
''c'' means. You want ``c''. 

Using -asciiplot- (SSC), a splendid user-written program rich in
characterisation _and_ plot (*), I make that ` (ASCII 96) and ' (ASCII 39). 

Nick 
n.j.cox@durham.ac.uk 

(*) My best joke today. 


-----Mensaje original-----
De: Steve Rothenberg [mailto:drlead@prodigy.net.mx] 
Enviado el: Wednesday, October 27, 2010 2:03 PM
Para: 'statalist@hsphsun2.harvard.edu'
Asunto: RE: polynomial distributed lag models error message

Thank you Nick, we now no longer get the error message with "namelist".  We
now get the error message 
	"c" not found r(111)

It's probably the use of the double quotes as found in the SJ code, where it
appears near the end of the last matrix line just before the first closing
bracket: matrix 'namelist'['r','c'] = (''c'')^('r' - 1).

We're systematically trying different quotes available in this Spanish
keyboard around the c's in this line, so far with no luck.  Could you
provide the ASCII codes for the proper quotes around the first and the
second c? I imagine we'll have to edit the quotes throughout the code that
Allen provided in the SJ article.

Steve Rothenberg 



>On #1 I could reproduce your problem by copying and pasting from the Stata
Journal archives into Stata's do->file editor under Windows. The problem in
that circumstance was that the right quotes that appear are not the >right
quotes that Stata uses to denote references to local macros. You should be
able to test this by comparison with the default single quote character (=
Stata's right quote) and the default left quote character. I'll not
elaborate because I have no idea what your keyboard looks like, but the
program looks fine to me when the correct quote characters are used. 

Having run the first very short leg of your unequal relay race, I'll throw
the baton right up in the air. 

Nick 
n.j.cox@durham.ac.uk 

-----Mensaje original-----
De: Steve Rothenberg [mailto:drlead@prodigy.net.mx] 
Enviado el: Wednesday, October 27, 2010 12:38 PM
Para: 'statalist@hsphsun2.harvard.edu'
Asunto: polynomial distributed lag models error message

We are trying to reproduce the analysis for using polynomial distributed lag
models found in SJ(2004) 4, Number 2, pp. 180-189, by Allen McDowell of
StataCorp.

When we try to form the Vandermonde matrix using the supplied program
-vandermonde-, the program returns an error message: 'namelist' invalid name
r(198); 

The issued command is:
	vandermonde V, n(0/12)
exactly as suggested in the article.

Though we are using Stata 11.1, the program -vandermonde- is stored as an
ado file with a version control statement "version 8.2", exactly as copied
from the SJ article.

We've tried using another name for the generated matrix instead of "V" when
running the command, as we see that V is now defined in Mata as a built-in
Vandermonde matrix, but we receive the same error message.

We have four questions:

1. Can anyone advise us why the program -vandermonde- returns the error
message?

2. Can we achieve the same results by running the Mata Vandermonde command
and if so, can you provide the proper syntax to set up the matrix and then
use the Mata generated matrix in the following Stata matrix manipulation
commands for polynomial distributed model in the SJ article?

3. Given eventual success with working through the example in the SJ
article, can we use these procedures to construct a Poisson model with
distributed lags of one of the independent variables and if so, how?

4. Since Allen McDowell wrote the article as a tutorial instead of providing
polished production code, does anyone know if there is newer provision for
running distributed lag models in independent variables, especially models
with count data dependent variables?


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index