SPSS Statistics

SPSS Statistics

Your hub for statistical analysis, data management, and data documentation. Connect, learn, and share with your peers! 

 View Only
  • 1.  Cox regression with multiple time-dependent covariates

    Posted Mon October 24, 2022 10:34 AM
    Despite inexperience with SPSS, I find entry of a single time-varying covariate alone or in combination with one or more time-independent covariates into a Cox regression model to be simple and straightforward.  Can you describe how to enter multiple time-varying covariates into a Cox model, which I understand to require use of Command Syntax; that is, can you describe which commands and where to insert them?
    Thank you in advance.

    ------------------------------
    Stuart Kaufman
    ------------------------------

    #SPSSStatistics


  • 2.  RE: Cox regression with multiple time-dependent covariates

    Posted Mon October 24, 2022 02:05 PM
    Hi. 

    From one of our statisticians:

    ----

    The UI pastes the following from the dialog where you create that one time-dependent covariate: 

    TIME PROGRAM.

    COMPUTE T_COV_={ }.

    What's inside the brackets is what you put in the Expression for T_COV_ box in the UI. So if you have more than one to define, just add more COMPUTE commands to the TIME PROGRAM, each one with a unique name (and you don't have to name the first one T_COV_ either, but can change that to something more specific for your situation).

    The TIME PROGRAM section is followed by the COXREG command that uses the time-dependent covariate(s) as predictors in the model.

    ----

    ------------------------------
    Rick Marcantonio
    Quality Assurance
    IBM
    ------------------------------



  • 3.  RE: Cox regression with multiple time-dependent covariates

    Posted Tue October 25, 2022 05:23 PM
    Dear Mr, Marcantonio,

    I am not certain if I successfully responded to the recommendation of your colleague yesterday.  if not, please allow me to restate. 

    In attempting to apply the suggested programming language to the Syntax generated from the Cox w/ Time-Dep Covariate graphical user interface ("PASTE"), the Cox w/ Time-Dep Covariate function failed completely.  I am no longer able to produce meaningful output even if adding only a single time-dependent variable into any model, that is, differing Times and Status.  Moreover, there are missing values declared that are not, in fact, actually missing.  What I see now is this: 

    Cox Regression
    Warnings
    There is a variable named T_, but there are no time-dependent covariates.

    Case Processing Summary
    N Percent
    Cases available in analysis Eventa 45 20.0%
    Censored 62 27.6%
    Total 107 47.6%
    Cases dropped Cases with missing values 118 52.4%
    Cases with negative time 0 0.0%
    Censored cases before the earliest event in a stratum 0 0.0%
    Total 118 52.4%
    Total 225 100.0%
    a Dependent Variable: Interval_m_ITx_to_Graft_Failure_or_End_Study

    Initially, I misunderstood your suggestion and tried to produce the necessary Syntax from scratch in a new Syntax Editor window, and perhaps, that had something to do with the failure.  However, before the failure and using the user interface, the resulting Syntax looked different from your preview in that I observed no braces ({ }) within the COMPUTE T_COV command.  Based on error messages, I assumed that my specific Covariate Expressions should be preceded by T_ within the braces, but I had no success either with or without starting within-brace expressions with T_. 

    I am rather desperate to fix this situation, so I thank you very much in advance for your time.

    ------------------------------
    Stuart Kaufman
    ------------------------------



  • 4.  RE: Cox regression with multiple time-dependent covariates

    Posted Wed October 26, 2022 07:59 AM
    In case this helps, the statistician responded:

    "The braces {} aren't supposed to be specified. They are like quotes that you don't specify when you actually implement the example."


    ------------------------------
    Rick Marcantonio
    Quality Assurance
    IBM
    ------------------------------



  • 5.  RE: Cox regression with multiple time-dependent covariates

    Posted Thu October 27, 2022 09:49 AM
    Dear Mr. Marcantonio,
    Thanks again to you and your colleagues for invaluable assistance.  In working out all of the numerous errors in my data entry, I have found a few things that may be generalizable and of interest to you and the rest of the Community:

    1. In addition to specifying all desired time-dependent covariates in the Syntax Editor under TIME PROGRAM, also remember to copy all of them into the METHOD sub-command under COXREG for inclusion in the type of regression analysis chosen (e.g. stepwise forward, backward, etc.).
    2. Before running the program (rightward green arrow) as completed in Syntax Editor, highlight with mouse the entire program.  I don't remember reading about this step in any of the instruction materials, and I don't know if this requirement is restricted to my own version 28.0 download.

    See illustration below:

    TIME PROGRAM.
    COMPUTE FIRST_T_COV_ = T_ > Age_Smoke.
    COMPUTE SECOND_T_COV_ = T_ > Age_Alcohol.
    COMPUTE THIRD_T_COV_ = T_ > Age_Grad.
    COXREG T_Survive
    /STATUS=Death('yes') /CONTRAST(Site_Birth01)=Indicator /CONTRAST(Sex)=Indicator
    /METHOD=BSTEP(LR) FIRST_T_COV_ SECOND_T_COV_ THIRD_T_COV_ Site_Birth01
    /PRINT=CI(95)
    /CRITERIA=PIN(.05) POUT(.10) ITERATE(20).


    Best personal regards,
    Stu Kaufman

    ------------------------------
    Stuart Kaufman
    ------------------------------