Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


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

Re: st: How to identify a string as a variable?


From   Nobuaki Michihata <gha10771@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: How to identify a string as a variable?
Date   Wed, 10 Oct 2012 12:39:37 +0900

Dear kantor.d,

It worked perfectly!!
It looks easy, but I couldn't find the solution by myself.
Thank you.

Nobu


On Wed, Oct 10, 2012 at 12:23 PM, kantor.d@att.net <kantor.d@att.net> wrote:
> Thi might get you started.
>
> local a = "p" + "rice" + "[1]"
> disp `a'
>
> Sent with Verizon Mobile Email
>
>
> ---Original Message---
> From: statalist@hsphsun2.harvard.edu
> Sent: 10/9/2012 10:11 pm
> To: statalist@hsphsun2.harvard.edu
> 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/
*
*   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/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index