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
bsqreg with fixed effectHi everyone, Is there an alternative to xtqreg with Bootstrapped errors? When I use bsqreg, I can n…
Calculate Difference between Last and First Observation in Time Series DataHello Statalist members, I want to calculate the difference between the last and first observations…
Extracting subset date from a timestamp date variableDear Colleagues Please help: I am trying to extract the first 8 characters (NEWdate) from a date fo…
infix usingHi, I am working with HCUP NIS data files. I get "using required". I don't know why! /**********…
icd9, invalid codesHi all, I am working with HCUP NIS files for year 2014. I run the following code: . icd9 check …
Subscribe to:
Post Comments (Atom)
0 Response to Dropping many variables if all observations contain a certain text
Post a Comment