I'm working with long data; I have about 100 columns (variables), with a lot of missing observations. I want to loop through the variables and delete columns with less than "some number", e.g., 32, of non-missing values. (This questoin is cross-listed on Stackexchange under the same title).
I tried the following:
but it deleted my observations instead dropping any columns.
I tried the following:
Code:
foreach var of varlist cid-lpop { 2. bysort `var': drop if _N < 32 3. }
Comment