From | "Mutysheva, Dinara" <[email protected]> |
To | [email protected] |
Subject | st: RE: creating lag variable |
Date | Wed, 9 Jun 2004 09:21:46 -0600 |
Just put a letter "l" and period after it, like if you want to lag variable x, it's
l.x -- x is lagged once
l2.x -- x is lagged twice and so on
-----Original Message-----
From: sarah smith [SMTP:[email protected]]
Sent: 2004-06-08 21:49
To: [email protected]
Subject: st: creating lag variable
Dear Stata users;
I am trying to create a lag variable
y(t) = x(t-1)
I searched for a lag function but could not find. Any suggestions?
Thanks,
Sarah
>From: Roger Newson <[email protected]>
>Reply-To: [email protected]
>To: [email protected]
>Subject: Re: st: Tempvars with ylabel
>Date: Tue, 08 Jun 2004 20:32:54 +0100
>
>At 19:35 08/06/2004, Doug A. Simmons wrote:
>>Is it possible to use tempvars (or some other Stata variable) to specify
>>values with the -ylabel- command? I have tried
>>-tempvar Mean-
>>-ylabel(`Mean', axis(2))-
>>but it gives me the error
>>"invalid label specifier, : __000000:".
>>
>>It appears to be evaluating to the macro name, but not the stored
>>value. I have tried using compound quotes, but get similar results.
>>
>>I am attempting to build a .do file that will automate the graphing of
>>data that varies such that `Mean' could be different at each run of the
>>file. I use -graph twoway line `Mean'- to generate a reference line on
>>my graph and it works as expected. It just doesn't seem quite right to
>>me that I can use the temporary variable to draw the graph, but not to
>>label it.
>>
>>Thank you for your assistance.
>
>Doug might like to use my -regaxis- package, downloadable from SSC, which
>inputs one or more variables and/or values which must be in the axis range
>and creates a set of axis labels as output in a macro. The package contains
>2 programs, -regaxis- for regular linear axes and -logaxis- for regular
>logarithmic axes. In Stata, type
>
>ssc describe regaxis
>
>to find out more.
>
>I hope this helps.
>
>Roger
>
>
>--
>Roger Newson
>Lecturer in Medical Statistics
>Department of Public Health Sciences
>King's College London
>5th Floor, Capital House
>42 Weston Street
>London SE1 3QD
>United Kingdom
>
>Tel: 020 7848 6648 International +44 20 7848 6648
>Fax: 020 7848 6620 International +44 20 7848 6620
> or 020 7848 6605 International +44 20 7848 6605
>Email: [email protected]
>Website: http://www.kcl-phs.org.uk/rogernewson
>
>Opinions expressed are those of the author, not the institution.
>
>*
>* 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/
_________________________________________________________________
Get fast, reliable Internet access with MSN 9 Dial-up - now 3 months FREE!
http://join.msn.click-url.com/go/onm00200361ave/direct/01/
*
* 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 |