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: margins after stcox with time-dependent covariate


From   [email protected]
To   [email protected]
Subject   Re: st: margins after stcox with time-dependent covariate
Date   Fri, 01 Mar 2013 11:05:31 +0100

Many thanks for your response and for your suggestions.

Mario Petretta

------------------------------

Date: Fri, 1 Mar 2013 08:28:39 +0100
From: Maarten Buis <[email protected]>
Subject: Re: st: margins after stcox with time-dependent covariate

Maybe, but it won't fit well with the logic underlying Cox regression.
Cox regression was invented to allow you to estimate the hazard ratios
without having to specify the baseline hazard function. This is a
strength of Cox regression, as you cannot make an error in a function
you do not specify, but it is also a weakness as it prevents you to
use all kinds of other measures that do depend on the baseline hazard
function.

So if you believe you need to use -margins- than that is a sure sign
that you did not want to estimate a Cox regression model. You may want
to look into -stpm2-, type in Stata -findit stpm2-.

Hope this helps,
Maarten

On Thu, Feb 28, 2013 at 7:40 PM,  <[email protected]> wrote:


[Show Quoted Text - 37 lines]
Dear list members,

I use Stata/IC 12.1 for Windows (32 bit).
I ask if the margins command may be used after stcox with three fixed
covariates (gender, Y Z) and only one time-varying covariate. In
particular, I used stsplit to handle the time-varying covariate, a X
tratment in the course of follow-up and time_X is the wait time for the X
treatment: some subjects may also never have the X treatment. I use the
following code:

gen wait = time_X
replace wait =0 if wait==.
stsplit, at(failures)
generate postX = wait<_t & wait!=0
stjoin
stcox postX##gender Y Z

I ask if thereafter it is possible to use the margins command to estimates
margins of responses for specified values of covariates.

Thanks for your consideration

------------------
Mario Petretta
Department of Translational Medical Sciences
Naples University Federico II
Italy




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



- --
- ---------------------------------
Maarten L. Buis
WZB
Reichpietschufer 50
10785 Berlin
Germany

http://www.maartenbuis.nl
- ---------------------------------
*
*   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/

------------------------------



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