0
$\begingroup$

I currently have a dataset that consists of survey data that has several columns that have answers dependent on the previous question. For example, I may have a question that says "Did you take medication in the previous year for heart disease" coded as a binary variable, while the next column will have the answer for "If so, what kind?" and a multilevel categorical variable.

My question is, is there a best practice for handling this kind of information? I have considered adding a new level to the categorical data that consists of "Not applicable", but currently the uncleaned data is coded as null. Leaving it as null seems incorrect however, as the data would be missing at random (MAR).

$\endgroup$

1 Answer 1

0
$\begingroup$

Those two questions should be encoded together to capture the conditional relationship. For example, the single feature could have the following categorical levels: no_medication, yes_medication_drug_a, yes_medication_drug_b, yes_medication_drug_other.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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