Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

Re: st: using varlist wildcards in anova


From   Vineet Bhagwat <[email protected]>
To   [email protected]
Subject   Re: st: using varlist wildcards in anova
Date   Sat, 3 Apr 2010 23:45:45 -0400

Thanks Phil!

On Sat, Apr 3, 2010 at 10:46 PM, Phil Schumm <[email protected]> wrote:
> On Apr 3, 2010, at 6:25 PM, Phil Schumm wrote:
>>
>> On Apr 3, 2010, at 5:45 PM, Vineet Bhagwat wrote:
>>>
>>> Which is weird, because on my computer's Stata, "reg y t* " and any other
>>> command using the asterisk works fine, just -anova- that seems to throw the
>>> error for some reason.  I'm using Stata9 on my computer if that clarifies
>>> anything.
>>
>>
>> Well, at least that narrows it down.  I no longer have a version of Stata
>> 9 on my machine, so I can't look at this issue further.  Perhaps someone
>> with Stata 9 still available (or a better memory of -anova- under version 9)
>> might be able to add something.
>>
>> One workaround would be the following (IIRC, -unab- predated Stata 9):
>>
>>   unab t: t*
>>   anova y `t'
>>
>> though upgrading, if possible, would clearly be preferable.
>
>
> Ok, I must confess that this made me a bit curious, especially since my
> previous statement
>
>
> On Apr 3, 2010, at 5:21 PM, Phil Schumm wrote:
>>
>> Regardless, this isn't due to -anova-, but rather is a function of how
>> Stata is parsing the command line.
>
>
> was clearly incorrect (I also misspoke when I said "parsing the command
> line" -- what I should have said was "expanding the varlist").  Instead,
> this *does* have to do with -anova-'s syntax.  I pulled an old copy of Stata
> 9, and sure enough, I get exactly the behavior Vineet describes.
>
> Unfortunately, in Stata 9 -anova- was a built-in command, so we can't look
> at the source.  However, the syntax diagram
>
>    anova varname [term [/] [term [/] ...]] [if] [in] [weight] [,
>          options]
>
>    where term is of the form   varname[{*||}varname[...]]
>
> suggests that -anova- was using its own approach to interpret the list of
> model terms, and although one could specify a model as a simple list of
> variables, -anova- under Stata 9 evidently didn't support varname globbing.
>
> In sum, the workaround I gave above is your only option under Stata 9.
>
>
> -- Phil
>
> *
> *   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index