# How to predict an event for different time intervals and compute score?

Let's say I have a medical dataset/EHR dataset that is retrospective and longitudinal in nature. Meaning one person has multiple measurements across multiple time points (in the past).

This dataset contains information about patients' diagnosis, labs, admissions, and drugs consumed, etc.

Now, if I would like to find out predictors that can influence mortality, I can use logistic regression (whether the patient will die or not).

But my objective is to find out what are the predictors that can help me predict whether a person will die in the next 30 days or the next 240 days, how can I do this using ML/Data Analysis techniques?

In addition, I would also like to compute a score that can indicate the likelihood that this person will die in the next 30 days? How can I compute the scores? Any tutorial, please?

Can you help with this please?

As discussed in your related question, this is readily accomplished via survival analysis, which explicitly models times to events. The trick is defining the time = 0 from which to evaluate survival times, in particular when you have followed the same individual over multiple potential start times. Analysis approaches also would depend on the type of event: death happens once per individual, but hospital re-admissions can happen many times for the same individual and you would need to take intra-individual associations among events into account.
The vignettes provided with the survival package in R provide a good introduction to the principles even if you end up using a different machine-learning approach.