Statalist


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

st: Comparing 2 models with -test- command under SVY


From   "Shellenberg, Kristen" <[email protected]>
To   "[email protected]" <[email protected]>
Subject   st: Comparing 2 models with -test- command under SVY
Date   Fri, 21 Aug 2009 16:53:55 -0400

Hello Statalist-ers,

About a year ago there was a post about comparing nested models (one with an interaction term and one without an interaction term) while using survey data and the woman who posted was told to use the -test- command and was provided code by Maarten in which he instructed her to force the coefficients of the interaction terms to be equal to 0.

I now have the exact same problem as the previous poster but I can't seem to translate the sample code to work with my data (this is the link to that post http://www.stata.com/statalist/archive/2008-11/msg01123.html and text is also posted below). I  have categorical*categorical interaction terms and I'm not sure if that is part of the problem.  Each term entering into the interaction terms has 4 or 5 categories so when I run my model it looks like this:

. xi3: svy: logistic stigma_yn i.age5*i.raceth i.union i.ieduc i.povcat3 i.ireligion
> i.itimeinUS i.insurance i.region
i.age5            _Iage5_1-5          (naturally coded; _Iage5_1 omitted)
i.raceth          _Iraceth_1-4        (naturally coded; _Iraceth_1 omitted)
i.union           _Iunion_1-4         (naturally coded; _Iunion_1 omitted)
i.ieduc           _Iieduc_1-4         (naturally coded; _Iieduc_1 omitted)
i.povcat3         _Ipovcat3_1-3       (naturally coded; _Ipovcat3_1 omitted)
i.ireligion       _Iireligion_1-4     (naturally coded; _Iireligion_1 omitted)
i.itimeinUS       _IitimeinUS_0-3     (naturally coded; _IitimeinUS_0 omitted)
i.insurance       _Iinsurance_0-4     (naturally coded; _Iinsurance_0 omitted)
i.region          _Iregion_1-4        (naturally coded; _Iregion_1 omitted)
(running logistic on estimation sample)
Survey: Logistic regression
Number of strata   =         7                  Number of obs      =      4146
Number of PSUs     =        93                  Population size    = 4125.8935
                                                Design df          =        86
                                                F(  40,     47)    =      4.91
                                                Prob > F           =    0.0000
------------------------------------------------------------------------------
             |             Linearized
   stigma_yn | Odds Ratio   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
    _Iage5_2 |   .6519237   .1351332    -2.06   0.042     .4317562    .9843623
    _Iage5_3 |    .791465   .1644478    -1.13   0.263     .5236584    1.196232
    _Iage5_4 |   .6950092   .2020618    -1.25   0.214     .3899302     1.23878
    _Iage5_5 |   .5621536   .1438475    -2.25   0.027     .3380148    .9349197
  _Iraceth_2 |     .27729    .067397    -5.28   0.000     .1710378    .4495483
  _Iraceth_3 |   .6354438   .1837908    -1.57   0.121     .3575765    1.129238
  _Iraceth_4 |   1.522723   .6657219     0.96   0.339      .638516    3.631365
   _Iag2Xra2 |   1.892653   .5600417     2.16   0.034     1.051002    3.408306
   _Iag2Xra3 |   1.239234   .4250937     0.63   0.533     .6266131    2.450797
   _Iag2Xra4 |   .5200602   .2612843    -1.30   0.197     .1915566     1.41192
   _Iag3Xra2 |   1.067876   .3455609     0.20   0.840     .5612341    2.031877
   _Iag3Xra3 |   .9946504   .2931404    -0.02   0.986     .5536393    1.786957
   _Iag3Xra4 |   .3279903   .1664101    -2.20   0.031     .1196272    .8992742
   _Iag4Xra2 |   .9478445   .3612668    -0.14   0.889     .4442991    2.022082
   _Iag4Xra3 |   1.038767    .530176     0.07   0.941     .3765942     2.86525
   _Iag4Xra4 |   .2598451    .148765    -2.35   0.021     .0832598    .8109497
   _Iag5Xra2 |   1.751892   .7131544     1.38   0.172     .7799346    3.935107
   _Iag5Xra3 |   1.009418   .3768195     0.03   0.980     .4805957     2.12013
   _Iag5Xra4 |   .5243718   .2864595    -1.18   0.241     .1770108    1.553384
   _Iunion_2 |   1.231949   .1559979     1.65   0.103     .9577888    1.584587
   _Iunion_3 |    1.21506   .1594978     1.48   0.141     .9359836    1.577347
   _Iunion_4 |   1.521763   .2374102     2.69   0.009     1.115978    2.075095
   _Iieduc_2 |   1.192253   .1610352     1.30   0.196      .911502    1.559478
   _Iieduc_3 |   1.412647   .1853921     2.63   0.010     1.088253    1.833738
   _Iieduc_4 |   1.539768   .2867434     2.32   0.023     1.063355    2.229629
 _Ipovcat3_2 |   .8198406   .0721716    -2.26   0.027     .6882208    .9766324
 _Ipovcat3_3 |    .994166   .1061167    -0.05   0.956     .8040916    1.229171
_Iireligio~2 |   1.195083    .117494     1.81   0.073     .9829202    1.453041
_Iireligio~3 |   1.079557   .1290552     0.64   0.524     .8512099     1.36916
_Iireligio~4 |   1.013235   .1638016     0.08   0.935     .7347503    1.397272
_IitimeinU~1 |   1.074207   .1776751     0.43   0.666     .7731953    1.492406
_IitimeinU~2 |   1.644738   .2959388     2.77   0.007     1.150148    2.352012
_IitimeinU~3 |   .8671913   .2087065    -0.59   0.555     .5374439    1.399254
_Iinsuranc~1 |   .8847986   .1607652    -0.67   0.502     .6165618    1.269733
_Iinsuranc~2 |   1.202234   .1829168     1.21   0.229      .888449    1.626841
_Iinsuranc~3 |   .7540169   .1588092    -1.34   0.184     .4960719    1.146087
_Iinsuranc~4 |   1.095395   .1789676     0.56   0.579     .7916176    1.515746
  _Iregion_2 |   1.651972   .3725572     2.23   0.029      1.05511     2.58647
  _Iregion_3 |   1.534596   .2128685     3.09   0.003      1.16476    2.021864
  _Iregion_4 |   1.545248   .2389391     2.81   0.006     1.136319    2.101341
------------------------------------------------------------------------------
Note: variance scaled to handle strata with a single sampling unit.


I want to compare this model with a model without the interaction term...Can anyone help me understand how to how to compare the two models? I tried using the -test- command after running the model that includes the interaction term and forcing the coefficients of the interaction terms to =0 but it didn't work. Also, there are so many interaction terms b/c of all the dummy variables that it just seems like a big mess!!

Any help would be greatly appreciated!

Thanks,

Kristen



*****************PREVIOUS POST that I refer to above*******************
Re: st: testing for interactions: svy models



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index