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]

st: variable name abbreviations for all n-way factor variable interactions when using -testparm-


From   "Beede, David N" <[email protected]>
To   "'[email protected]'" <[email protected]>
Subject   st: variable name abbreviations for all n-way factor variable interactions when using -testparm-
Date   Fri, 6 Aug 2010 15:56:57 -0400

I am stumped by this notation problem.
If you are estimating n-way factorial specifications using factor variables and want to test if the coefficients for all m-way or greater interactions (where m <= n) are jointly equal to zero, why can't you do something like:
       testparm *#*#* 
(in the case where you are estimating, say 6-way factorial specification but want to test if all 3-way and higher interactions are zero)?

When I tried this (see example below) I got more than just the 3-way interactions.  I know in the case of the example I could just do testparm group#sex#arm, but what if I have 8 (the maximum number of interactions allowed using factor variables and the ## notation) variables?  

Thank you for any help you can provide!

David

. use http://www.stata-press.com/data/r11/fvex
(Artificial factor variables' data)

. regress y agegroup##sex##arm

      Source |       SS       df       MS              Number of obs =    3000
-------------+------------------------------           F( 23,  2976) =   22.69
       Model |  207587.375    23  9025.53803           Prob > F      =  0.0000
    Residual |  1183845.63  2976  397.797591           R-squared     =  0.1492
-------------+------------------------------           Adj R-squared =  0.1426
       Total |  1391433.01  2999  463.965657           Root MSE      =  19.945

------------------------------------------------------------------------------
           y |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
    agegroup |
          2  |   7.872115   8.063784     0.98   0.329    -7.939041    23.68327
          3  |   1.795313   7.479324     0.24   0.810    -12.86986    16.46048
          4  |  -5.772757   7.404368    -0.78   0.436    -20.29096    8.745443
             |
       1.sex |    29.8375   7.499731     3.98   0.000     15.13232    44.54268
             |
agegroup#sex |
        2 1  |  -10.86605   8.634784    -1.26   0.208    -27.79681    6.064697
        3 1  |   -8.05146    8.00574    -1.01   0.315    -23.74881    7.645886
        4 1  |  -8.217461    7.90107    -1.04   0.298    -23.70958    7.274653
             |
         arm |
          2  |   12.10533   7.246137     1.67   0.095    -2.102614    26.31328
          3  |   19.42648   7.126994     2.73   0.006     5.452143    33.40081
             |
agegroup#arm |
        2 2  |  -8.279273   8.369064    -0.99   0.323    -24.68901    8.130464
        2 3  |  -7.253848   8.247162    -0.88   0.379    -23.42456     8.91687
        3 2  |   -3.18379   7.828699    -0.41   0.684      -18.534    12.16642
        3 3  |  -4.491854   7.768685    -0.58   0.563    -19.72439    10.74068
        4 2  |  -4.008206   7.850135    -0.51   0.610    -19.40045    11.38404
        4 3  |  -2.475406   8.000771    -0.31   0.757    -18.16301     13.2122
             |
     sex#arm |
        1 2  |  -11.87131   7.945362    -1.49   0.135    -27.45027    3.707648
        1 3  |  -13.01725   7.964627    -1.63   0.102    -28.63398    2.599485
             |
    agegroup#|
      sex#arm|
      2 1 2  |   10.41656   9.304878     1.12   0.263    -7.828081    28.66121
      2 1 3  |   3.438556   9.717089     0.35   0.723    -15.61434    22.49145
      3 1 2  |   3.063942   8.717606     0.35   0.725     -14.0292    20.15709
      3 1 3  |  -.2612288   9.452897    -0.03   0.978    -18.79611    18.27365
      4 1 2  |   6.733436   8.711734     0.77   0.440     -10.3482    23.81507
      4 1 3  |  -3.543607   10.05656    -0.35   0.725    -23.26212    16.17491
             |
       _cons |    51.5625   7.051574     7.31   0.000     37.73605    65.38895
------------------------------------------------------------------------------

. testparm *#*#*

 ( 1)  2.agegroup = 0
 ( 2)  3.agegroup = 0
 ( 3)  4.agegroup = 0
 ( 4)  1.sex = 0
 ( 5)  2.agegroup#1.sex = 0
 ( 6)  3.agegroup#1.sex = 0
 ( 7)  4.agegroup#1.sex = 0
 ( 8)  2.arm = 0
 ( 9)  3.arm = 0
 (10)  2.agegroup#2.arm = 0
 (11)  2.agegroup#3.arm = 0
 (12)  3.agegroup#2.arm = 0
 (13)  3.agegroup#3.arm = 0
 (14)  4.agegroup#2.arm = 0
 (15)  4.agegroup#3.arm = 0
 (16)  1.sex#2.arm = 0
 (17)  1.sex#3.arm = 0
 (18)  2.agegroup#1.sex#2.arm = 0
 (19)  2.agegroup#1.sex#3.arm = 0
 (20)  3.agegroup#1.sex#2.arm = 0
 (21)  3.agegroup#1.sex#3.arm = 0
 (22)  4.agegroup#1.sex#2.arm = 0
 (23)  4.agegroup#1.sex#3.arm = 0

       F( 23,  2976) =   22.69
            Prob > F =    0.0000
David N. Beede, Ph.D.
Economist
Office of Policy Development
Economics & Statistics Administration
U.S. Department of Commerce
Office:  Room 4872
Mailstop:  Room 4858 HCHB
1401 Constitution Avenue, N.W.
Washington, DC  20230
Telephone (202) 482-1226
[email protected]




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