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: Test for effect modification/interaction using svy


From   Steve Samuels <[email protected]>
To   [email protected]
Subject   Re: st: Test for effect modification/interaction using svy
Date   Mon, 3 Feb 2014 19:02:45 -0500

Sorry, I misdescribed the output for the first (incorrect) command. It shows 7 terms. There are 8 combinations of the two factors. Each displayed factor represents the
difference between the stated combination against the 11 term, the baseline.


Steve

The first command, with

i.vdpcat#excessVA

is incorrect because it does not separate main effects from
interactions; instead it fit a separate parameter for each of the 2 x 3
combinations of the two terms. You would have seen this if you had examined
the results.

The second formulation with i.vcpcat##excessVA

creates the main effect terms automatically and so is the correct
equation.

(as would be the command with main effects & interactions specified
individually "i.vdpcat excessVA i.vdpcat#excessVA")

As a result, the 3 d.f. test for interaction generated by

. testparm i.vdpcat#exbloodVA

is correct. If you are still unclear about interactions, "search
interaction, all" will yield many resource.


Steve
[email protected]






> On Jan 31, 2014, at 7:27 AM, Schmutz Einat <[email protected]> wrote:
> 
> Dear all
> 
> 
> 
> I am trying to statistically compare two cox regression models (nested) using svy commands to see whether effect modification exists. What I did is I included an interaction term (2 categorical variables) and run the adjusted Wald test (as postestimation commands normally used after stcox, such as lrtest, don't work with svy).
> 
> 
> 
> Syntax for the two models I want to compare („i.vdpcat“ is the exposure variable, “var1-4” are confounding variables and “excessVA” is the potential effect modifier):
> 
> 
> 


> svyset [w=weightvar], psu(psuvar) strata(straatavar) vce(linearized)
> stset timevar, failure (failvar)
> 
> svy, subpop(if ...): stcox var1 var2 i.var3 i.var4 i.vdpcat
> 
> svy, subpop(if ...): stcox var1 var2 i.var3 i.var4 i.vdpcat#excessVA
> 

> 
> testparm i.vdpcat#excessVA
> 
> 

> What I get is:
> ----------------------------------------------------------------------------------
>                |             Linearized
>             _t | Haz. Ratio   Std. Err.      t    P>|t|     [95% Conf. Interval]
> -----------------+----------------------------------------------------------------
> ...
> ...
> vdpcat#exbloodVA |
>           1 2  |   1.170165   .1309874     1.40   0.167     .9344425    1.465352
>           2 1  |   .9572346   .0975444    -0.43   0.670     .7799799    1.174771
>           2 2  |   .9208137   .1008386    -0.75   0.455     .7389192    1.147484
>           3 1  |   .8220665   .0850683    -1.89   0.064     .6677197    1.012092
>           3 2  |   .9301641   .0882042    -0.76   0.449     .7687764    1.125432
>           4 1  |   .8522502   .0738444    -1.85   0.071     .7160554    1.014349
>           4 2  |   .8321073   .0976341    -1.57   0.124     .6573199    1.053372
> ----------------------------------------------------------------------------------
> 
> . testparm i.vdpcat#exbloodVA
> 
> Adjusted Wald test
> 
> ( 1)  1b.vdpcat#2.exbloodVA = 0
> ( 2)  2.vdpcat#1b.exbloodVA = 0
> ( 3)  2.vdpcat#2.exbloodVA = 0
> ( 4)  3.vdpcat#1b.exbloodVA = 0
> ( 5)  3.vdpcat#2.exbloodVA = 0
> ( 6)  4.vdpcat#1b.exbloodVA = 0
> ( 7)  4.vdpcat#2.exbloodVA = 0
> 
>      F(  7,    43) =    3.12
>           Prob > F =    0.0094
> 
> What I understand is that there is a statistically significant difference in survival among the 8 groups. Now, can I conclude that, since the Wald test is significant (p≤0.05), there is an interaction between vdpcat and exbloodVA and that the second model (including the interaction variable) is the better/more accurate model in predicting my outcome (survival)?
> 
> In addition, what does the following test (using ##) tell me? Is this the accurate way to test a possible interaction between vdpcat and excessVA?
> 
> svy, subpop(if ...): stcox var1 var2 i.var3 i.var4 i.vdpcat##excessVA
> 
> testparm i.vdpcat#excessVA
> 
> 
> ----------------------------------------------------------------------------------
>                |             Linearized
>             _t | Haz. Ratio   Std. Err.      t    P>|t|     [95% Conf. Interval]
> -----------------+----------------------------------------------------------------
> ...
> ...
>    2.exbloodVA |   1.170165   .1309874     1.40   0.167     .9344425    1.465352
>                |
>         vdpcat |
>             2  |   .9572346   .0975444    -0.43   0.670     .7799799    1.174771
>             3  |   .8220665   .0850683    -1.89   0.064     .6677197    1.012092
>             4  |   .8522502   .0738444    -1.85   0.071     .7160554    1.014349
>                |
> exbloodVA#vdpcat |
>           2 2  |    .822065   .1190204    -1.35   0.182     .6145367    1.099675
>           2 3  |   .9669529    .157167    -0.21   0.837     .6975098     1.34048
>           2 4  |   .8343821   .1049943    -1.44   0.157     .6479522    1.074452
> ----------------------------------------------------------------------------------
> 
> . testparm i.vdpcat#exbloodVA
> 
> Adjusted Wald test
> 
> ( 1)  2.exbloodVA#2.vdpcat = 0
> ( 2)  2.exbloodVA#3.vdpcat = 0
> ( 3)  2.exbloodVA#4.vdpcat = 0
> 
>      F(  3,    47) =    1.11
>           Prob > F =    0.3540
> 
> 


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