Statalist


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

Re: st: AW: xi help


From   moleps islon <moleps2@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: AW: xi help
Date   Thu, 27 Aug 2009 12:04:25 +0200

Getting closer, but not quite there yet...If it is impossible to
create longer stubs, then instead a command that take the different
values of a variable and create new indicator variables based on the
label of the values

eg

tab a
q 25
p 34
o 97

tab a,nol

1 25
2 34
3 97

what I need then is to create variables based on the value labels so that:

tab q
0 131
1 25

tab p
0 122
1 34

etc..







On Thu, Aug 27, 2009 at 12:56 AM, Martin Weiss<martin.weiss1@gmx.de> wrote:
>
> <>
>
>
> If this was indeed possible, the rule that the stub cannot be longer than 4
> characters would require Stata to cut your value labels short, if they
> happened to violate the rule.
>
> If you wanted the variable label as the prefix, appropriately abbreviated:
>
> ***
> sysuse auto, clear
> xi i.rep, prefix(`=substr("`:var la rep78'",1,4)')
> ***
>
>
> HTH
> Martin
>
>
> -----Ursprüngliche Nachricht-----
> Von: owner-statalist@hsphsun2.harvard.edu
> [mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von moleps islon
> Gesendet: Donnerstag, 27. August 2009 00:37
> An: statalist@hsphsun2.harvard.edu
> Betreff: st: xi help
>
> Is it possible to have xi incorporate the value label into the new
> stub instead of the number?
>
> Regards,
> M
> *
> *   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/
>
>
> *
> *   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/
>

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index