[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: help! Strange error in Stata

From   "Kyle K. Hood" <>
Subject   st: help! Strange error in Stata
Date   Wed, 02 Jul 2008 12:42:35 -0400

This code (within a do-file)

. sum year
. local minyear = r(min)
. local maxyear = r(max)
. local yrdiff = `maxyear’ - `minyear’ // T-1

Generates the following result (and error):

Variable | Obs Mean Std. Dev. Min Max
year | 2244 1979.5 12.70126 1958 2001
`maxyear’ invalid name

When I type the same code on the command line, I don't get the error -- 
however, when I erase and retype the code within the do-file, I get the 
same error. I am running Stata/SE 9. I really have no idea what is going 
on. I have scrutinized for spelling, etc. The code that I sent was 
copied out of the do-file directly. I do wonder about the right single 
quote (it looks funny), but I am using Stata's do-file editor, and am 
using the single-quote-key directly to the left of the "enter" key. Can 
anyone help?

*   For searches and help try:

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