Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

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

st: Creating new variables in mata.

From   Amadou DIALLO <>
To   statalist <>
Subject   st: Creating new variables in mata.
Date   Wed, 19 Feb 2014 16:22:11 +0100


Maybe this has been already answered, but I can't find it.
What is the equivalent of the stata code below in mata?

forv i = 1/10 {
   cap drop var`i'
   g var`i' = ...

I've read Bill's "mata matters: macros" and creating new variables,
but I can't find how to parse the "i".


Amadou B. DIALLO, PhD.
Senior Economist, AfDB.
*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index