Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Simple slope analysis after stcox and margins for 3-way interaction: understanding the difference between dydx, at, contrast and pwcompare

    Dear all,

    I have some difficulties understanding what code to use for my case. I have done a cox analysis in which I have a three-way interaction between nationality, gender and age diversity.
    See below plot for the output

    Click image for larger version

Name:	temp.JPG
Views:	1
Size:	43.9 KB
ID:	1742292


    I am now trying to do a simple slope comparison in which I compare the slopes, so I can make inferences on the three-way interaction.

    However, I am confused as to which code I have to use and why.

    Specifically, I am confused regarding the dydx vs at option as well as the contrast vs pwcompare option.

    Code:
    margins, dydx(BlauNationality) at(BlauGender=(0 .5) VariationAge=(0 .24)) pwcompare(effects)
    Do I have to use dydx for nationality, should I not reference nationality (
    Code:
    margins,at (BlauGender=(0 .5) VariationAge=(0 .24)) pwcompare(effects)
    ) or should I add it between the at brackets (
    Code:
    margins,at(BlauNationality= (0 1) BlauGender=(0 .5) VariationAge=(0 .24)) pwcompare(effects)
    )
    Why should I use contrast vs pwcompare?
    My variables are in theory continuous and fall between certain values with. Namely nationality diversity ranges from 0-1, gender diversity from 0-.5 and age diversity doesn't have a "theorethical limit" but I use SD+/- 1 in the plot (0 = -1SD and .24 = +1SD).

    With the first snippet of code I get non-significant results, as well as if I use contrast instead of pwcompare.
    With the second snippet of code I get significant results.

    Thanks in advance for the advice and help!
    Best regards,
    Laura
Working...
X