Hello,
I'm somewhat new to STATA and was looking for days to find an appropriate solution. I hope you can help me to solve my question...
My dataset contains some missing data. For illustrative purposes, I provide three (example!) variables and their type:
1. Age: Continuous variable (integer)
2. Level of education: Ordinal variable (1: low, 2: intermediary, 3: high)
3. Gender: Nominal variable / dummy (1: male, 2: female)
For Age, I want to compute the sample mean (but exclude missing values in the computation) and assign the computed sample mean only to the missing values.
For Level of education, I want to compute the mode (value with highest frequency) of the sample and assign that value of that mode to the missing values.
For Gender, I want to compute the mode of the sample and assign that value of that mode to the missing values.
Furthermore, what is the best way to deal with multiple modes? Given that the ordinal and nominal variables have categorical values, taking the average of two modes is not going to work.
Thank you!
Best, Dave
I'm somewhat new to STATA and was looking for days to find an appropriate solution. I hope you can help me to solve my question...
My dataset contains some missing data. For illustrative purposes, I provide three (example!) variables and their type:
1. Age: Continuous variable (integer)
2. Level of education: Ordinal variable (1: low, 2: intermediary, 3: high)
3. Gender: Nominal variable / dummy (1: male, 2: female)
For Age, I want to compute the sample mean (but exclude missing values in the computation) and assign the computed sample mean only to the missing values.
For Level of education, I want to compute the mode (value with highest frequency) of the sample and assign that value of that mode to the missing values.
For Gender, I want to compute the mode of the sample and assign that value of that mode to the missing values.
Furthermore, what is the best way to deal with multiple modes? Given that the ordinal and nominal variables have categorical values, taking the average of two modes is not going to work.
Thank you!
Best, Dave
Comment