Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: RE: Executing a string representation of a command


From   "E. Paul Wileyto" <[email protected]>
To   [email protected]
Subject   Re: st: RE: Executing a string representation of a command
Date   Mon, 17 Nov 2008 10:38:54 -0500

Thanks.  It's harder in Matlab, and I assumed it would be similar here.

Paul

Nick Cox wrote:
You just refer to it: At the command prompt: . `vL' In a do-file `vL'
The point is that Stata sees the macroname and replaces it by its
contents. Then it is evident that -label- (in this case) has some work
to do.
Nick
[email protected]
E. Paul Wileyto

Suppose I've done some programming that creates a macro containing a string representation of a command. For example:

. ma list vL
vL: label var EMOID_OA_CR_plac "Emotion ID, Overall Correct Response Count, On Placebo."

How do I now execute that string in a macro as if I had type it in, or had written it explicitly as part of a do-file?

If I search on "execute string" in help, there is no response.

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


--
E. Paul Wileyto, Ph.D.
Assistant Professor of Biostatistics
Tobacco Use Research Center
School of Medicine, U. of Pennsylvania
3535 Market Street, Suite 4100
Philadelphia, PA  19104-3309

215-746-7147
Fax: 215-746-7140
[email protected]



*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   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