# Define Time-Dependent Predictor (Complex Samples Cox Regression)

The Define Time-Dependent Predictor dialog box allows you to create
a predictor that is dependent upon the built-in time variable, *T_*. You can use this variable to define time-dependent
covariates in two general ways:

- If you want to estimate an extended Cox regression
model that allows nonproportional hazards, you can do so by defining
your time-dependent predictor as a function of the time variable
*T_*and the covariate in question. A common example would be the simple product of the time variable and the predictor, but more complex functions can be specified as well. - Some variables may have different values at different
time periods but aren't systematically related to time. In such cases,
you need to define a
**segmented time-dependent predictor**, which can be done using logical expressions. Logical expressions take the value 1 if true and 0 if false. Using a series of logical expressions, you can create your time-dependent predictor from a set of measurements. For example, if you have blood pressure measured once a week for the four weeks of your study (identified as*BP1*to*BP4*), you can define your time-dependent predictor as (*T_*< 1) **BP1*+ (*T_*>= 1 &*T_*< 2) **BP2*+ (*T_*>= 2 &*T_*< 3) **BP3*+ (*T_*>= 3 &*T_*< 4) **BP4*. Notice that exactly one of the terms in parentheses will be equal to 1 for any given case and the rest will all equal 0. In other words, this function means that if time is less than one week, use*BP1*; if it is more than one week but less than two weeks, use*BP2*; and so on.*Note:*If your segmented, time-dependent predictor is constant within segments, as in the blood pressure example given above, it may be easier for you to specify the piecewise-constant, time-dependent predictor by splitting subjects across multiple cases. See the discussion on Subject Identifiers in Complex Samples Cox Regression for more information.

In the Define Time-Dependent Predictor dialog box, you can use the function-building controls to build the expression for the time-dependent covariate, or you can enter it directly in the Numeric Expression text area. Note that string constants must be enclosed in quotation marks or apostrophes, and numeric constants must be typed in American format, with the dot as the decimal delimiter. The resulting variable is given the name you specify and should be included as a factor or covariate on the Predictors tab.

How To Define Time-Dependent Predictors

This feature requires the Complex Samples option.

- From the menus choose:
- Select a plan file. Optionally, select a custom joint probabilities file and then click Continue.
- In the Complex Samples Cox Regression dialog box, click the Predictors tab and then click New.
- Name the time-dependent predictor.
- Create the expression defining the time-dependent predictor.