Statalist


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

RE: st: Number of characters in a variable label


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   RE: st: Number of characters in a variable label
Date   Mon, 15 Feb 2010 16:18:23 -0000

Try a dose of SMCL, e.g. 

. di `"{p 2 2 2} `rep78[foo]'{p_end}"'

Nick 
[email protected] 

Alan Neustadtl

This is a great tip.  Now, is there anyway to suppress the line split
character ">" from being inserted?

For example:

***** Stata Output from Maarten's Example *****
. di `" `rep78[foo]' "'
 This is a very long "label", which in your case would be the question. I am go
> ing to continue to write just to show how long it can get.
***** END *****


On Mon, Feb 15, 2010 at 10:44 AM, Maarten buis <[email protected]> wrote:
> --- Mosi Ifatunji wrote:
>> Unfortunately this has not solved the problem. I know
>> "needing/wanting" more than 80 characters is not the norm for
>> a variable label, but I am looking to generate a printout
>> with the original questions and some basic frequency
>> distributions.
>
> --- On Mon, 15/2/10, Nick Cox  answered:
>> Not so. As the thread flagged by Eric does clearly indicate,
>> characteristics may be used for this purpose; and you may
>> -display- them at any time in a session.
>
> Just to reinforce this with an example:
>
> *------------------------ begin example -----------------
> sysuse auto, clear
> char rep78[foo] `"This is a very long "label", which in your case would be the question. I am going to continue to write just to show how long it can get."'
>
> // to display the "question" followed by the frequencies you type:
> di `" `rep78[foo]' "'
> tab rep78
>
>
> // this label is longer than 80 characters:
> di length(`"`rep78[foo]'"')
> *---------------------- end example -----------------------
>

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   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