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
Related Posts with Dropping many variables if all observations contain a certain text
Difference-in-differences: regress or teffects?Dear Statalist users, I have been working on trying to find whether there has been a positive impact…
Are the missing values being coded as zero?Hi all, I have data on certain variables for four rounds. Following are the number of observations …
Format stata summary output table with multiple variables Code: * Example generated by -dataex-. To install: ssc install dataex clear input str6 Gender floa…
How to count the individual digits in a string numberHi, I have survey data. Both the variables a7 and a8 are survey variables having multiple options c…
Questions about two-wayHi I need to customize my graph that is plotted by twoway scatter as follows: 1-drawing a diagonal l…
Subscribe to:
Post Comments (Atom)
0 Response to Dropping many variables if all observations contain a certain text
Post a Comment