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

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.
Do I have to use dydx for nationality, should I not reference nationality (
) or should I add it between the at brackets (
)
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
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
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)
Code:
margins,at (BlauGender=(0 .5) VariationAge=(0 .24)) pwcompare(effects)
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