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: Re: How to perform calculations on a set of tempvars

From   francesco manaresi <>
Subject   st: Re: How to perform calculations on a set of tempvars
Date   Sat, 25 Sep 2010 09:01:41 +0200

I created sets of tempvars of the type
containing the result of a statistic (say, a p-value) calculated for
variable `x' in State `i'

I would like to perform calculations and have the result in another
macro. For instance, I want the minimum of all the p-values by State.
However, Stata does not accept the following syntax:

tempvar minimum
g `minimum' = min(`var_`i'_*')

invalid syntax

I believe this is because Stata doesn't accept asterisks (jolly
character) within macronames.
Am I right? What can I do alternatively, apart from creating hundreds
of real variables?
*   For searches and help try:

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