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: Main effect for time-varying covariate


From   Steve Samuels <[email protected]>
To   [email protected]
Subject   Re: st: Main effect for time-varying covariate
Date   Thu, 29 Aug 2013 09:49:29 -0400

The second sentence should be: "I consider it professionally irresponsible
to answer a question if I'm unsure that a poster has accurately characterized
the substantive problem."
S.


Nicole, Statalist is not a help line in which responders are obligated to
answer questions, as asked. I consider it professionally irresponsible
to answer a question if I'm that a poster has accurately characterized
the substantive problem. Your initial question showed some uncertainty,
so I asked you to "describe what it [your covariate] is and how its
values are determined." You didn't do this, so I asked again.


As you've observed, the tvc() option is confusing. In particular, it is
not used only for testing the PH assumption. So let's review the
possibilities,

1. Your covariate "z", say, assumed 0-1, is time-varying. If z appears
only in the main variable list for -stcrreg- (or -stcox-), you are
making the PH assumption, and the estimated hazard ratio exp(b)
describes the relative hazard of occurrence for someone with Z, compared
to someone without z.

2. You say you are not interested in assessing the PH assumption, but
how can you know that it's true?. You check it as follows:

a) Include the covariate in the tvc() list, which by default enters the
covariate into an interaction with _t. However the default assumes that
the HR increases or decreases with time and will miss non-linear
interactions (e.g. the HR rises, then falls).

b) The preferred approach is to first plot the Schoenfeld residuals
against time. (Grambsch, Patricia M, and Terry M Therneau. 1994.
Proportional hazards tests and diagnostics based on weighted residuals.
Biometrika 81, no. 3: 515-526.). These plots will suggest the form of
the expression to use in the texp() option.

3. In 2a, the covariate appears in both the main and tvc() lists. But it
is possible to fit a PH model with a time-varying covariate that is
entered *only* in the tvc() list. This can occur if the effect of
covariate is proportional to a known function of time. The example on p.
137 of the Survival manual shows a decay function:

. stcox age, tvc(drug1 drug2) texp(exp(-0.35*_t))

Here the effects of the drug "wear off".

4. To elaborate on this example, suppose that a continuous "exposure" x0
is measured at time 0, but is subject to the same decay function. as
above. Thus x(t) = x0*exp(-0.35*t)

You can tell Stata about this in two ways:

a. Create the split data set with the value for x from the equation above.
Then put x into the main predictor list:

. stcox x

(I show -stcox-, since I don't know what your -stcrreg- command looks
like.)

b. Enter x0 into the tvc() list:

. stcox , tvc(x0) texp(exp(-0.35*_t))

In both cases, x(t) = x0*exp(-0.35*t) and the hazard ratio compares the
hazards for (x(t)+1) and x(t). The HR is still constant at all values of
t.

5. It is also possible to allow for a differential effect of x at
baseline, still keeping the PH assumption.

. stcox x0, tvc(x0) exp(-0.35*_t)

Here the equation for the log hazard function is:

log(h(t|x0) = log(h(t) + x0*(b1 + b2*exp(-0.35*_t))

The HR exp((b1 + b2*exp(-0.35*_t)) compares hazards for (x0+1) and x0

6. Finally, one can prepare the data as in 2a, but then check the PH
assumption with the tvc() statement and residual plots.

. stcox x, tvc(x)

Steve




On Aug 28, 2013, at 5:36 PM, Nicole Boyle wrote:

Forgive me, but I don't understand how discussing these nuances is relevant
when addressing the original inquiry: determining the theoretical utility and
interpretation of a time-varying covariate whose time-invariant component has
been excluded from the model. These concerns seem more in line with a
discussion about lead/length time bias.

Nevertheless, to assuage your concerns, these patients are continually
monitored for the presence of this particular risk factor, regardless
of exhibited symptoms.

________________________________________
From: [email protected]
[[email protected]] on behalf of Steve Samuels
[[email protected]]
Sent: Wednesday, August 28, 2013 1:34 PM
To: [email protected]
Subject: Re: st: Main effect for time-varying covariate

Nichole:

Please explain what the risk factor is and how its activation depends
on the medical records. Perhaps you mean that the presence of the risk
factor is known only after some test, and that test is recorded in the
records. If so, the fact that the test is made at time "t" doesn't
preclude the presence of the factor before "t". Also, if the test was
made in response to certain symptoms, then other issues arise.

Steve


On Aug 27, 2013, at 5:00 PM, Boyle, Nicole M wrote:

Hi Steve,

Thanks for your response! I've elaborated on the issue in more
(perhaps excessive) detail:


***Variable details***
I'd like to model a binary variable as time-varying. This binary
variable will model the onset of a particular
risk factor. All patients under study enter into the study with this
risk factor "turned off." The timing of
when this risk factor "turns on" depends entirely on each patient's
medical records (and for some patients,
this risk factor may never "turn on"). This risk factor can only go
from "off" to "on"; the reverse ("on" to "off")
is not possible.


***Reason for modeling this var as time-varying***
I would like to model this particular risk factor as a time-varying
covariate in order to assess its association
with the outcome while avoiding possible immortal time bias. In other
words, I'd like assess the hazard ratio
(at any instantaneous time during observation) for the outcome event
comparing those with the risk factor
"turned on" vs. those with the risk factor "turned off", accounting
for the possibility that a patient's risk factor
may be "turned on" at any time before or after his/her outcome event.


***Stata's covariate vs. coefficient distinction***
Right now, the closest I can find to an answer is a mention in the
Stata Statistical Analysis Manual:

       http://www.stata.com/manuals13/ststcox.pdf#ststcoxRemarksandexamples

In said manual, Cox models are run with and without the time-invariant
component (on page 12 and pages
13-14, respectively). The Stata manual differentiates between models
fit with time-varying COVARIATES
(without the time-invariant component) from models fit with
time-varying COEFFICIENTS (with the time-invariant
component), saying

     "Above we used tvc() and texp() to demonstrate fitting models
with time-varying covariates, but
      these options can also be used to fit models with time-varying
coefficients."

I think this aforementioned covariate/coefficient distinction may be
the source of my confusion. From the
manual's suggestion, it seems like adding this time-invariant
component (aka: "main effect") will only test
the proportional hazards assumption of the coefficient.


Thanks,
Nicole
________________________________________
From: [email protected]
[[email protected]] on behalf of Steve Samuels
[[email protected]]
Sent: Wednesday, August 21, 2013 2:13 PM
To: [email protected]
Subject: Re: st: Main effect for time-varying covariate

I'd need to know details about the internal covariate before I can
answer your question. So please describe what it is and how its values
are determined.

Steve

On Aug 20, 2013, at 7:14 PM, Boyle, Nicole M wrote:

Hi all,

I'm modeling a multivariable competing risks regression model
(stcrreg), and I want to include an internal
time-varying covariate.

(1) Should I include a main effect for this time-varying covariate in
the model? (I'm not trying to test
the proportionality assumption here)

(2) How does one report the overall value and significance of this
time-varying variable?

Thanks,
Nicole

(my apologies if this is a duplicate... 1st email bounced)
*
*   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/

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

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