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

st: Re: RE: To: statalist@hsphsun2.harvard.edu


From   "Rodrigo Alfaro" <ralfaro@bu.edu>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: Re: RE: To: statalist@hsphsun2.harvard.edu
Date   Wed, 30 Nov 2005 19:28:33 -0500

Try

forvalues i=1(1) 10 {
gen var`i' = vary/varx+log(`i')... etc
}

Note that `i' is not the same as 'i'... type the following to see the correct character
h forvalues

Rodrigo.

----- Original Message ----- From: "Carter Rees" <carterrees@gmail.com>
To: <statalist@hsphsun2.harvard.edu>
Sent: Wednesday, November 30, 2005 7:22 PM
Subject: st: RE: To: statalist@hsphsun2.harvard.edu



This may be of help. I used the sort because I had date variables that I
wanted in order. Your mileage may vary.

sort varnames
quietly by varnames: gen varname = cond(_N==1,0,_n)

Carter
-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Yang Li
Sent: Wednesday, June 30, 2004 9:17 PM
To: undisclosed-recipients:
Subject: st: To: statalist@hsphsun2.harvard.edu

Could anyone advice how to generate variable name with a incremental
counter in it.
What I intend to do is:
local i=0
gen var'i'=a-b (suggestion required)
i=i+1

Best Regards,
Yang


--
UTS CRICOS Provider Code: 00099F
DISCLAIMER: This email message and any accompanying attachments may contain
confidential information. If you are not the intended recipient, do not
read, use, disseminate, distribute or copy this message or attachments. If
you have received this message in error, please notify the sender
immediately
and delete this message. Any views expressed in this message are those of
the
individual sender, except where the sender expressly, and with authority,
states them to be the views the University of Technology Sydney. Before
opening any attachments, please check them for viruses and defects.
*
* 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/

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