If you want to count the number of observations that just spaces or entirely missing for birthyear you want the following code
To look at the values of the birthyears with non-numeric values you might try
Code:
*create a new variable with leading and trailing spaces removed *this will cause any variable that is all spaces to be missing gen newby=trim(birthyear) **count if the new variable is missing count if missing(newby)
Code:
** prevent results scrolling past set more on **create a flag for observations that are not real numbers and also not blank or missing mark nonnum if missing(real(birthyear))==1 & missing(trim(birthyear))~=1 **now look at the contents of birthyear for those observations list birthyear if nonnum==1
Comment