Stata Unab

The ubav command un-abbreviates Stata names.

Contents

  1. Stata Unab
    1. Usage


Usage

Given a macro defined like var1 var2 var3, it is possible to write syntax like:

foreach var of local list {
  display "`var'"
}

This is not possible with a macro defined like var1-var3, i.e. a variable list that needs to be expanded.

The unab command parses abbreviated names and sets a local macro with the un-abbreviated equivalent.

unab newlist: `list'
foreach var of local newlist {
  display "`var'"
}


CategoryRicottone

Stata/Unab (last edited 2025-03-05 20:23:39 by DominicRicottone)