Hi statalist,
I've got a very wide dataset, with quite a lot of missing values, each line is identified with a unique ID. My goal is to display, for each ID, all the variable with missing values.
I usually use the code below when dealing with missing data. However it gives me the ID associated with a missing observation for a given variable instead of giving me all the variable with missing observations for a given ID.
Here's an example of what i'd like obtain
Any help would be greatly apperciated,
Bilel
I've got a very wide dataset, with quite a lot of missing values, each line is identified with a unique ID. My goal is to display, for each ID, all the variable with missing values.
I usually use the code below when dealing with missing data. However it gives me the ID associated with a missing observation for a given variable instead of giving me all the variable with missing observations for a given ID.
Code:
mdesc list ID if missing(var)
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input str18 make int(price mpg rep78) "AMC Concord" . 22 3 "AMC Pacer" 4749 17 3 "AMC Spirit" . 22 . "Buick Century" 4816 20 3 "Buick Electra" . . . end
Code:
ID | Missing_variable "AMC Concord" price ------------------------------ "AMC Spirit" price "AMC Spirit" rep78 ------------------------------ "Buick Electra" price
Bilel
Comment