Handling missing values of a categorical covariate I have a longitudinal dataset with records from 22902 individuals. The outcome is a continuous variable and has no missing values. However, one of the predictors (from a total of 8) has some missing values. This predictor refers to the patient's smoking status (Yes or No), and I have no record of such status for 9430 individuals.
Since this variable does not change over time, I think the smoking status was accessed upon the first medical appointment and kept that way; in cases where the information is unavailable, the patient must not have disclosed their smoking status when first evaluated. So I don't think it is related to the outcome.
How to handle this?
Suppose I remove the cases where the values are missing. In that case, I lose information on 9430 patients. So I thought about creating a third category: "missing" or "unknown", and carrying on with the analysis. But I'm not sure that would be the correct way of handling this.
I appreciate any help you can provide. Thanks!

Using a separate category for missing covariate data is called the "Indicator Method." Stef van Buuren discusses that in Section 1.3.7 of Flexible Imputation of Missing Data (FIMD). In some restricted circumstances that can be OK, but he warns:

the method ... generally fails in observational data. It has been shown that the method can yield severely biased regression estimates, even under MCAR [missing completely at random] and for low amounts of missing data...

If you knew that your smoking status was MCAR then you might be OK with the listwise deletion of cases without smoking status; see Section 2.7 of FIMD. You would, however, be throwing away a lot of data and have coefficient standard errors on the order of 30% higher than what you would have with the entire data set.
Follow the advice of @rep_ho in a comment, and use multiple imputation to get multiple copies of the data with different estimates of the smoking status, and put the information from their models together as explained by van Buuren, who developed the mice package in R for that purpose. As the missing data is restricted to smoking status, that should mean that the imputation-associated error is mostly restricted to the smoking coefficient while you take advantage of the full data set for all predictors.
