b******s 发帖数: 325 | 1 Can you tell me if there is a way to write a STATA macro that takes a few
arguments? What I want to do is:
macro_A(name1, name2, string1, name3)
gen name1=name2
label variable name1 string1
label values name1 name3
drop name2
This macro takes a variable named “name2” and creates a new variable named
“name1” from it. Then it assigns a variable label “string1” to the
newly created variable. String1 can be any string such as “Number of
children in the household”. Then it assigns the new variable a |
|