# Solved – Logistic Regression on Time-dependent Predictors

I would like to know if I can apply the techniques, like say Logistic Regression, to data whose variables/predictors are 'indexed' by time. Or if not, what techniques are appropriate to use in these kinds of data.

To give you a clear picture of the problem, say I have a dependent variable Y, whose values are 0 or 1 (for binary case), or 1,2,3,… (for polytomous case).

And I have predictor variables which are 'indexed' by time, i.e., X1T1, X1T2,…,X1Tn, X2T1, X2T2,…, X2Tm,….XpTk,

where

X1T1 = values of variable X1 at time 1 (T1)

X1T2 = values of variable X1 at time 2 (T2)

``. . ``

X1Tn = values of variable X1 at time n (Tn)

X2T1 = values of variable X2 at time 1 (T1)

X2T2 = values of variable X2 at time 2 (T2)

``. . ``

X2Tm = values of variable X2 at time m (Tm)

``. . . ``

XpTk = values of variable Xp at time k (Tk)

where n,m,k = 1,2,… (variable time 'index') p =1,2,…. (# of predictor variables).

For the data view, I have;

``Obs   X1T1   . . .  X1Tn X2T1 . . . X2Tm . . . XpTk  1     .     . . .   .     .  . . .  .    . .   .  2     .     . . .   .     .  . . .  .    . .   .  .     .     . . .   .     .  . . .  .    . .   .  .     .     . . .   .     .  . . .  .    . .   .  .     .     . . .   .     .  . . .  .    . .   .  N     .     . . .   .     .  . . .  .    . .   . ``

Can I apply a technique, like say, logistic regression on these types of data (or other techniques for 'multi' category response variable like tree based methods.). If not, what's the appropriate technique that can be used. Thanks a lot!

Contents

The R `rms` package can do all this for binary and ordinal \$Y\$ using functions `lrm`, `orm`, `robcov`, `bootcov`. You can reshape the data using the built-in R function `reshape` plus others.