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, is already up and running.

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

st: question about local and var[n]

From   "G. Dai" <>
To   statalist <>
Subject   st: question about local and var[n]
Date   Mon, 24 Oct 2011 23:47:11 -0600

Dear all,
I have one question about the use of local macros.
For example, assume the date

ID     ny_price
ny      5
wa      4

set obs 2
gen str ID=""
replace ID="ny" in 1
replace ID="wa" in 2
gen ny_price=4
replace ny_price=5 in 1

Then My question comes from the following differences:

. local city ny

. replace `city'_price=100 in 1
(1 real change made)


. local city ID[1]
. di `city'
. replace `city'_price=100 in 1
weights not allowed

*   For searches and help try:

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