Hi all! I have been encountering error with local macros. The last time I had this issue and got stuck, I simply used global instead (I understand it's not recommended at all) but it worked. But I have gotten stuck again. I have gone through the forums in here and also the stata documentation and tried several methods, but to no avail. So, any help is much appreciated.
Three variants I tried:
When I try to look at the contents of the macro after running the code with the following:
the display code returns empty and macro list returns:
Thank you so much in advance!
Three variants I tried:
Code:
local hhld_variables `" "hhid" "totmemb" "total_absentee" "season" "devreg" "ecobelt" "dist" "dname" "vdcmun" "vname" "urbrur" "ward" "subward" "hhname" "team" "intrdate" "iday" "imonth" "iyear" "intervwr" "suprvisr" "operator" "religion" "fmlymemb" "tot5plus" "q01" "q02" "q03" "q04" "q05" "q061" "q061n" "q062" "q062n" "q063" "q063n" "q064" "q064n" "q065" "q065n" "q07" "q081" "q081unit" "q081rb" "q081ak" "q081pd" "q082" "q082unit" "q082rb" "q082ak" "q082pd" "q083" "q083unit" "q083rb" "q083" "'
Code:
local hhld_variables `"psu hhid totmemb total_absentee season devreg ecobelt dist dname vdcmun vname urbrur ward subward hhname team intrdate iday imonth iyear intervwr suprvisr operator religion fmlymemb tot5plus q01 q02 q03 q04 q05 q061 q061n q062 q062n q063 q063n q064 q064n q065 q065n q07 q081 q081unit q081rb q081ak q081pd q082 q082unit q082rb q082ak q082pd q083 q083unit q083rb q083ak q083pd q111 q122 no_rem_sender"'
Code:
local hhld_variables psu hhid totmemb total_absentee season devreg ecobelt dist dname vdcmun vname urbrur ward subward hhname team intrdate iday imonth iyear intervwr suprvisr operator religion fmlymemb tot5plus q01 q02 q03 q04 q05 q061 q061n q062 q062n q063 q063n q064 q064n q065 q065n q07 q081 q081unit q081rb q081ak q081pd q082 q082unit q082rb q082ak q082pd q083 q083unit q083rb q083ak q083pd q111 q122 no_rem_sender
Code:
display "`hhld_variables'" macro list _hhld_variables
Code:
local macro `hhld_variables' not found r(111);
Comment