-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allowing two kinds of missing values (kept and not in regressions) and handling labelled variables both as numeric and character #770
Comments
Hi @bixiou, can you please explain what feature you are requesting in detail, including why this would be helpful and examples of the desired behaviour? This should all be included in the issue rather linking to external discussion. Thanks! |
Sure, let me explain. Analyzing surveys, I'd like to allow treating some missing values as special but not as NA. For example, take a variable "vote" taking values "Left", "Center/Right", "Far right" and (the missing value:) "PNR" (People Not Responding). NA would be reserved for a lack of answer (e.g. the question was not asked in this survey branch) rather than for a PNR answer. Below is an example where missing values could be treated differently, in a plot of answers: I also have to deal with data that is sometimes best handled as numeric, sometimes as character. For example, take a 5-Likert scale variable (named "scale") from "Strongly oppose" to "Strongly agree", which we can recode from -2 to +2. It's handier to write the following condition "scale > 0" rather than "scale %in% c('Somewhat agree', 'Strongly agree')", especially given that the scale labels can change depending on the question. At the same time, I'd like both ways of writing this condition to work. Finally, in regressions, I would like to keep missing values by default. For example, Ideally, missing values should be treated as a character while not preventing meaningful numerical comparison. For example, if there is the missing value "PNR" in scale[1], we'd ideally have both To sum up, here are the behaviors I'd wish:
The package |
This is a feature request, cf. here.
The text was updated successfully, but these errors were encountered: