Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


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

Re: st: margins after stcox with time-dependent covariate


From   Maarten Buis <maartenlbuis@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: margins after stcox with time-dependent covariate
Date   Fri, 1 Mar 2013 08:28:39 +0100

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,  <petretta@unina.it> wrote:
> 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/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index