Statalist


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

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


From   "Mentzakis, Emmanouil" <e.mentzakis@abdn.ac.uk>
To   "'statalist@hsphsun2.harvard.edu'" <statalist@hsphsun2.harvard.edu>
Subject   st: RE: I can't run a simple program!
Date   Wed, 18 Jun 2008 22:01:44 +0100

Maybe this?

cap prog drop count6
program count6
 forvalues i=1/6 {
 display `i'
}
End

Count6

Cheers
Manos

-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Solorzano, Jenniffer
Sent: 18 June 2008 21:57
To: statalist@hsphsun2.harvard.edu
Subject: st: I can't run a simple program!

Hi,
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
r(198);


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

Thanks

-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Man Jia
Sent: Wednesday, June 18, 2008 4:55 PM
To: statalist@hsphsun2.harvard.edu
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.

Thanks!

Mandy


John-Paul Ferguson wrote:


>Dear Mandy,
>
>I think that trying to manipulate j within the "if" statement on your
fourth
>line is causing the problem. If you first create another local macro
that's
>equal to that value and include it, the loop should work correctly. See
below:
>
>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.
Adjust
>accordingly.
>
>Best,
>
>John-Paul Ferguson
>MIT

*
*   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/


*
*   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/


The University of Aberdeen is a charity registered in Scotland, No SC013683.

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index