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

st: RE: I can't run a simple program!

From   "Steichen, Thomas J." <>
To   "''" <>
Subject   st: RE: I can't run a simple program!
Date   Wed, 18 Jun 2008 17:01:40 -0400

The problem is that `i' is being evaluated in the first line and becomes a blank.

The correct form is:

forvalues i = 1/6 {

Thomas J. Steichen

-----Original Message-----
From: [] On Behalf Of Solorzano, Jenniffer
Sent: Wednesday, June 18, 2008 4:57 PM
Subject: st: I can't run a simple program!

I don't know what is happening with my stata version. I'm trying to run
this simple program....

. program count6
  1. forvalues `i'=1/6 {
  2. display `i'
  3. }
  4. end

. count6
_= invalid name

And that error appears from nothing, somebody can help me?


-----Original Message-----
[] On Behalf Of Man Jia
Sent: Wednesday, June 18, 2008 4:55 PM
Subject: st:Re: variables named T099`j'

Hi Mr. John-Paul Ferguson,

Thanks for your help! It works well. I did exactly as you suggested.



John-Paul Ferguson wrote:

>Dear Mandy,
>I think that trying to manipulate j within the "if" statement on your
>line is causing the problem. If you first create another local macro
>equal to that value and include it, the loop should work correctly. See
>local j 0802
>forvalue i=1/8 {
>  g age`i'=2006-T099`j'
>  local k = `j'-1
>  replace age`i'=2006-T099`j'-1 if T099`k' > 5
>  local j = `j' + 500
>I am assuming that the first "T099`j'-1" in the "replace" line is
>supposed to be the value of T099`j' minus 1, not the value of T099`k'
>as defined here.
>John-Paul Ferguson

*   For searches and help try:

*   For searches and help try:

CONFIDENTIALITY NOTE: This e-mail message, including any
attachment(s), contains information that may be confidential,
protected by the attorney-client or other legal privileges, and/or
proprietary non-public information. If you are not an intended
recipient of this message or an authorized assistant to an intended
recipient, please notify the sender by replying to this message and
then delete it from your system. Use, dissemination, distribution,
or reproduction of this message and/or any of its attachments (if
any) by unintended recipients is not authorized and may be

*   For searches and help try:

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