Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

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

st: populating a local macro with a stringvariable

From   Daniel Pilsgaard Henriksen <>
Subject   st: populating a local macro with a stringvariable
Date   Mon, 19 Dec 2011 13:33:40 +0100

Dear Statalist

I'm new to using macros in stata, and I'm having trouble populating
local macro with a variable containing strings sorted by their length
instead of their order of apperence. Here's an example of my problem

inp str30 alt

gen len = length(alt)
sort length
levelsof alt, loc(i)
di `"`i'"'

I'm sure there're a easy way of doing this, but I've tried for some
time now and it's not showing up.

Daniel Henriksen
Ph.d. studerende, læge
Infektionsmedicinsk afd Q / Akut Modtage Afdelingen
Odense Universitetshospital

*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index