Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: st: How to identify a string as a variable?
From
"[email protected]" <[email protected]>
To
<[email protected]>
Subject
RE: st: How to identify a string as a variable?
Date
Tue, 9 Oct 2012 20:23:38 -0700 (PDT)
Thi might get you started.
local a = "p" + "rice" + "[1]"
disp `a'
Sent with Verizon Mobile Email
---Original Message---
From: [email protected]
Sent: 10/9/2012 10:11 pm
To: [email protected]
Subject: st: How to identify a string as a variable?
Hello,
I need help!
I'm looking for the way to identify a text string as a variable.
Here is an example.
.clear
.sysuse auto
. di price[1]
4099
. di ("p"+"rice"+"[1]")
price[1]
On the last command, I need "4099", not "price[1]".
Is there any string function to identify a string as a variable's name?
Thank you for your help!
Nobu
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/