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: joint significance of categorical var


From   John Antonakis <[email protected]>
To   [email protected]
Subject   Re: st: joint significance of categorical var
Date   Thu, 29 Nov 2012 17:41:56 +0100

There is even a faster way if you use -testparm- in combo with factor variables:

sysuse auto
reg price i.rep78 i.foreign c.weight##c.weight
testparm i.rep78 i.foreign

HTH,
J.

__________________________________________

Prof. John Antonakis
Faculty of Business and Economics
Department of Organizational Behavior
University of Lausanne
Internef #618
CH-1015 Lausanne-Dorigny
Switzerland
Tel ++41 (0)21 692-3438
Fax ++41 (0)21 692-3305
http://www.hec.unil.ch/people/jantonakis

Associate Editor
The Leadership Quarterly
__________________________________________

On 29.11.2012 15:35, Maarten Buis wrote:
> On Thu, Nov 29, 2012 at 3:11 PM, Constantin Alba wrote:
>> i am trying to find a way to calculate joint significance of
>> categorical variable in case when there are many categories.
>>
>> one way i know is to use "test" command and enter all categories manually e.g.
>> if variable type has 3 categories then i use:
>>
>> test 1.type 2.type 3.type
>>
>>
>> but what if i have few such categorical variables and there are much
>> more categories. how i can avoid manual entry of all of them?
>
> *------------ begin example ------------
> sysuse auto
> reg price i.rep78 i.foreign c.weight##c.weight
> _ms_extract_varlist i.rep78 i.foreign
> test `r(varlist)'
> *------------- end example -------------
> (For more on examples I sent to the Statalist see:
> <http://www.maartenbuis.nl/example_faq> )
>
> Hope this helps,
> Maarten
> ---------------------------------
> Maarten L. Buis
> WZB
> Reichpietschufer 50
> 10785 Berlin
> Germany
>
> http://www.maartenbuis.nl
> ---------------------------------
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/faqs/resources/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/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index