{smcl} {* 18May2009}{...} {cmd:help wfex_miss}: Working with missing values {hline} {title:List of examples} 1. Create indicator of cases without missing values in a set of variables. 2. Select cases if specific variables are missing or not missing. 3. Create indicator if any of a set of variables are missing. 4. Summarize missing data in a dataset. {title:1. Create indicator of cases without missing values in a set of variables} * create variable notmissing to indicate no missing values for a set of variables mark notmissing label var notmissing "No missing in ?" * notmissing is 1 if no missing in markout notmissing * label values label def notmissing 0 0_missing 1 1_nomiss label val notmissing notmissing tab notmissing, missing * keep cases where no missing on keep if notmissing {title:2. Select cases if specific variables are missing or not missing} Note: Add your variable name for and {bf:2a. Select cases with missing values for } keep if missing() {bf:2b. Select cases that do not have missing values for } keep if !missing() {bf:2c. Select cases that do not have missing values for or } keep if !missing() & !missing() {title:3. Create indiator if any of a set of variables are missing} gen ismiss = miss(,,,...) label var ismiss: Are any of to missing? label def ismiss 0 0_nomiss 1 1_somemiss label val ismiss ismiss {title:4. Summarize missing data in dataset} misschk {p}For details, {cmd:help }{helpb misschk}. {cmd:misshck} is part of the SPOST package. {p2colset 5 12 12 2} {title:Also see} Chapter _ of the {it:Workflow} book; {helpb misschk}; {helpb mark}; {helpb wf:Workflow} INCLUDE help wf_footer