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

Re: st: RE: Tempname and Tempvar - help desperately needed


From   "Maureen Paul" <[email protected]>
To   [email protected]
Subject   Re: st: RE: Tempname and Tempvar - help desperately needed
Date   Wed, 19 Jun 2002 16:10:16 +0100

Hi

Thanks very much for your help. However, permit me to restate my 
problem. It is like this: If I do not specify "tempvar y`x'iqq 
y`xless1'iqq;" within the loop as below, I get the error message that 
"too few variables specified" which after using 'set trace on' and 
'mat li' translates into "global macro $ge is not recognised" or 
something like that. On the other hand, including it solves that 
problem but introduces another - looping through encounters tempvar 
again and yields the error message that the variable has already been 
created. 

I suppose, what I would like to know is whether tempvar and tempname 
cannot be used in the way that I am trying to and if so, is there any 
other way I can get the programme to automatically drop variables 
without me having to explicitly tell it to do so? As you can see 
below, the names y`x'iqq y`xless1'iqq are set to change as x and 
xless1 changes.


 if `j'~=`depmax' { ;
		tempvar y`x'iqq y`xless1'iqq; 
		capture drop `y`x'iqq' ;       
		if _rc == 0 { local dropvar="`dropvar' `y`x'iqq`" } ;
		ge `y`x'iqq' = 0 `if' ;
		replace `y`x'iqq'=( `phiwj' ) / ( `PHIwj' - `PHIwj_1' ) if `1'==`j' 
& `ifexp' ;
	} ;

_______________________________________________
Miss Maureen Paul
Department of Economics
University of Warwick
Coventry CV4 7AL
UK

Phone: +44 (0)24 76528418
Email: [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