I have a large data set in which various missing codes have been established from -8 to -2. Examining variables in the browser shows that very few have actual responses. Tallying them with tabulate gives me frequencies such as 37 good responses in 4900 cases. The missing values mostly indicate that the question was not asked. Can I write a routine that would allow me to cycle through all variables compute the mean of each and discard those where the mean is perhaps less than -7.5? I know how to set up the "for each" procedure, but am not sure how to feed the mean (perhaps from the command "mean") to the loop.
for each var in varlist v1-v3000
drop if [MEAN OF] `var' <-7.5
I do not know the syntax well enough to write this test successfully.
Thanks!
for each var in varlist v1-v3000
drop if [MEAN OF] `var' <-7.5
I do not know the syntax well enough to write this test successfully.
Thanks!
Comment