Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: gen variables that equals to local


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: gen variables that equals to local
Date   Sun, 19 Jan 2003 17:07:04 -0000

Ada Ma
> 
> Thanks for the help offered earlier.  I have yet another 
> problem.  This time
> I'm writing a program that loops through 99 files and then 
> merge them all
> together in the end.  I want to create a varible that 
> equals to the value of
> the local variable, so that I can tell which file the 
> observation originally
> comes from.
> 
> e.g. I have:
> 
> local i=1989
> while i<2000 {
> use `i'
> gen year=`i'
> save `i', replace
> clear
> }

What's the problem? 

BTW, sounds more an -append- job than 
a -merge- job to me. 

Nick 
[email protected] 
*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index