[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: a simple macro problem

From   "Martin Wang" <>
To   "" <>
Subject   st: a simple macro problem
Date   Sat, 28 Jun 2008 02:53:18 +0800

Dear all,

I have the following macro, but it doesn't work as I expected:
I have gov1, gov2

and I wrote:

local dvar=" gov`j' totalassets"
 local j=1

 while `j'<3{
  reg sales `dvar'
  local j = `j' + 1

I expect this will run sales= gov1 totalassets and  sales= gov2 totalassets, but only the first one ran twice, no second one. Anyone could help me out?

Many thanks!


*   For searches and help try:

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