Statalist The Stata Listserver


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

Re: st: long macro


From   "Dedman, Dan" <[email protected]>
To   <[email protected]>
Subject   Re: st: long macro
Date   Wed, 22 Feb 2006 17:12:29 -0000

Thanks all - I eventually worked out the issue evaluating vs. copying macros, but I am still struggling with the double and single quotes (it's a been a while...)
I believe -forval-, -levelsof- and -valuesof- don't help me, either because they sort the values, or they require a numeric variable. I need the values in a pre-specified order.

Dan Dedman
[email protected]


>>
The issue is not whether it is a string. It is that you are evaluating when you should be copying. The limit that bites is different.

Given Stata 9, -while- is less direct than -forval-.

local codelist forval i = 1/`= _N' { local codelist `codelist' `=icd10code[`i']' }

That said, what you want is already provided by either -levelsof- in official Stata or the -valuesof- just announced by Ben Jann.

Nick [email protected]
<<


*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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