I am facing difficulties in dropping some variables conditional on the missing observations of one variable.
I have a dataset of prices, volumes and a measure of liquidity for 200 stocks. The dataset is a time series made of 601 variables, date, p1-p200, vo1-vo200 and liq1-liq200.
I want to drop p*, vo* and liq* if liq* has less than 30 observations.
I have tried
Code:
foreach var of varlist * { qui count if missing(`var') if r(N) >= 7535 drop `var' }
Any suggestion?
Best
Stefano
0 Response to Drop variables with common suffix under certain conditions
Post a Comment