-2
$\begingroup$

In an epidemic disease dataset of 3 months, I have a feature (var dt_died) with the death dates of patients (800 people died out of all 12k unique subjects in this dataset, so obviously only dead subjects have data for this feature).

I also have a feature that indicates the (var dt_test_positive) date of testing positive for the disease (with no missing values).

I would like to combine these two features into one (var difference). If I just make the difference for all dead people and just put zero in all other people with no dead flag, the person who just tested positive at the end of the third month and who not survived after 3rd month still have no flag for died or not, but has same value ZERO as other survived people.

May I know any proper way to create a variable to incorporate the two variables I mentioned above as a single one?

Edit: I have other 300 plus features and would like to include these two features as one. This is not a target variable. I have another variable with the outcome (died or not) and I am trying to predict mortality.

$\endgroup$
1
  • $\begingroup$ Hi, please don't delete your existing question, it's better to ask a new question: new questions are more likely to be seen by contributors. When you ask a new question please try to explain clearly what you want to do. $\endgroup$
    – Erwan
    Jun 12 at 22:47
1
$\begingroup$

It seems that your target variable (died or not) is also a feature (dt_died) so the problem is ill defined. Essentialy any ML algorithm would predict 'died' when it encounters a missing value in dt_died.

$\endgroup$
1
  • $\begingroup$ I would like to include the feature "difference". So Is it okay to keep zero for people who not died? $\endgroup$
    – DOT
    Jan 5 at 21:02

Not the answer you're looking for? Browse other questions tagged or ask your own question.