Dear Colleagues,
I am analyzing a large panel survey data of family members with over 5000 variables. Since my analysis include only children and youth, I dropped the records for adults. However, many variables that are asked only of adults and not relevant to my analysis of children and youth are still in the data. Most of these variables have invalid values (unknown, not applicable) for youth/children. I would like to find out and drop these variables; however, since there are too many of them, it is non practical for me to identify and drop them using the "drop var list" command.
I know there are commands like "dropmiss" that can be used to drop variables with all missing values. But the variables I would like to drop have negative values such as -1 -8 to indicate unknown or not applicable values instead of missing ".". Besides, I don't want to recode the negative values of -1,-8 to missing for all variables (they can affect the variables for children and youth).
Would you please suggest any command/codes I can use to identify and drop these variables with all negative and/or missing values?
Thanks in advance.
Lijun
I am analyzing a large panel survey data of family members with over 5000 variables. Since my analysis include only children and youth, I dropped the records for adults. However, many variables that are asked only of adults and not relevant to my analysis of children and youth are still in the data. Most of these variables have invalid values (unknown, not applicable) for youth/children. I would like to find out and drop these variables; however, since there are too many of them, it is non practical for me to identify and drop them using the "drop var list" command.
I know there are commands like "dropmiss" that can be used to drop variables with all missing values. But the variables I would like to drop have negative values such as -1 -8 to indicate unknown or not applicable values instead of missing ".". Besides, I don't want to recode the negative values of -1,-8 to missing for all variables (they can affect the variables for children and youth).
Would you please suggest any command/codes I can use to identify and drop these variables with all negative and/or missing values?
Thanks in advance.
Lijun
Comment