Statalist The Stata Listserver


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

Re: st: Help with varlist manipulation


From   "K Jensen" <[email protected]>
To   [email protected]
Subject   Re: st: Help with varlist manipulation
Date   Thu, 23 Nov 2006 12:04:50 +0000

Sadly, I missed your message in all my emails and have just found it.
It would have been quicker to use your suggestion, but I have found a
way to more-or-less "un-xi" a varlist using the variable labels
generated by xi.

Thanks for your help
Karin

On 20/11/06, Jeph Herrin <[email protected]> wrote:
Karin,

Can you pass the varlist to the ado file as a string of the
form:
       "mpg _Irep78_* length"

? Then you can use -unab- to produce the list you have below
and this macro can easily be manipulated into the form you desire.

hth,
Jeph





K Jensen wrote:
> Hi everybody
>
> I am writing an ado file to help with some modelling I'm doing. One of
> the input arguments is a varlist of the independent variables.
>
> I am trying to produce additional "friendly" output to describe the
> model, particularly for variables produced using "xi" from categorical
> data. It is only me using it--so I know that I won't be making dummy
> variables differently--but other people will be looking at the output.
>
> Using the auto data as an example say my varlist was:
> mpg _Irep78_2 _Irep78_3 _Irep78_4 _Irep78_5 length (method always
> involves a constant)
>
> I would like to dereference the varlist to become just a list with
> string members and from it produce the list:
> "mpg" "rep78 (categorical)" "length"
>
> I have tried looping through the varlist and trying various string
> functions on it but am getting nowhere.
>
> Thanks for your help!
> Karin
> *
> *   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/
>
>
*
*   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/

*
*   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