Dear All,

I am having trouble with a command in Stata and no matter how much I researched beforehand, I could not find a solution. I have a dataset that contains cross sectional data. There are around 1500 variables, where many of them contain from observation 1 to observation 29000 the value -1, i.e. ''missing''. I am trying to create a command that tells Stata that if a variable has only the value -1 from the first observation until the last one, then it should drop this variable and this should be done for all the variables that have this problem. Does anyone know how to proceed?

I thank you all for your time and your opinion.

Best.

Lola

I am having trouble with a command in Stata and no matter how much I researched beforehand, I could not find a solution. I have a dataset that contains cross sectional data. There are around 1500 variables, where many of them contain from observation 1 to observation 29000 the value -1, i.e. ''missing''. I am trying to create a command that tells Stata that if a variable has only the value -1 from the first observation until the last one, then it should drop this variable and this should be done for all the variables that have this problem. Does anyone know how to proceed?

I thank you all for your time and your opinion.

Best.

Lola

## Comment