Hello,
I'm facing an issue with tagging observations with missing values in a dataset containing both numerical and string variables. Variables:
Diagnostics Attempted
Result: No missing values considered missing.
Thank you!
Best regards,
Sami
I'm facing an issue with tagging observations with missing values in a dataset containing both numerical and string variables. Variables:
- _304753 (double)
- _304754 (double)
- _304755 (long)
- _306872 (str14)
- _309592 (double)
- _900420 (long)
- _900565 (long)
Code:
gen void = 0 local bob _304753 _304754 _304755 _309592 _900420 _900565 foreach var in `bob' { replace void = 1 if missing(`var') } replace void = 1 if _306872 == ""
- Using missing() function:
Code:
replace void = 1 if missing(_304753) & missing(_304754) & missing(_304755) & _306872 == "" & missing(_309592) & missing(_900420) & missing(_900565)
- Using == . for numerical variables:
Code:
replace void = 1 if _304753 == . & _304754 == . & _304755 == . & _306872 == "" & _309592 == . & _900420 == . & _900565 == .
- Result: Syntax error.
Thank you!
Best regards,
Sami
Comment