I collected data on about 2000 participants via an online survey. I am now in the process of cleaning that data (with about 100 variables) and have come across an issue in coding missings. There are two possible scenarios of missings in my data set.
1. someone skipped a question and thus did not answer that single question (see example ID 1)
2. someone answered the first few questions and then stopped, thus discontinued the survey (see example ID 2)
Both missings are coded as "." right now.
A single observation could include both kinds of missings in different variables. (see example ID 3, here Var 2 was not answered and then the survey was discontinued after Var 3)
Example
ID | Var 1 | Var 2 | Var 3 | Var 4 | Var 5 |
1 | Yes | . | No | No | N0 |
2 | Yes | . | . | . | . |
3 | Yes | . | No | . | . |
I would now like to replace "." with "-1" for scenario 1 and with "-2" for scenario 2. Does anyone have an idea of how I could do that using a loop or a different form of automization?
I would like to avoid having to go through all observations manually.
Any help is greatly appreciated.
Thanks in advance.
Maike
0 Response to Different kinds of missings
Post a Comment