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

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,

On Thu, Feb 28, 2013 at 7:40 PM,  <> 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:
> *
> *
> *

Maarten L. Buis
Reichpietschufer 50
10785 Berlin
*   For searches and help try:

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