Hello I need help learning how to drop a variable if one or more observations are greater than a number x. I tried googling this but what i found didn't help or was for one specific variable or if all variables were to be looked at. I only want to look at 100 of the 150 variables I have in my dataset.
Ex. I have variables dist_stop1, dist_stop2 and so on till 100. I want to be able to write a loop that will drop variable "dist_stopP" (with P being a number 1-100) if that variable has an observation bigger than say 33.315.
So if dist_stop4 has observations smaller than 30 and has one observation that is 40.56 then the loop will drop dist_stop4 then move on to dist-stop5.
All of the dist_stop variables are float types.
I have been googling and reading for an hour but nothing is helping. Please help me. Thank you for reading and helping.
Related Posts with Dropping Variables Based on Condition and in a Loop
Fisher-type test for unit rootHi, I run a panel model using PCSE. Before that, I want to check for stationarity. My panel data is …
Oaxaca Blinder Decomposition InsignificantHello, I have the results of oaxaca blinder decomposition like this. Code: Blinder-Oaxaca decomposi…
distance between two addresses (with latitude and longitude)Dear all, I ask this question for someone else (here in Chinese), The data is Code: * Example gener…
issue of number of instruments in xtdpdsysHello everyone. I have an unbalanced panel for 105 countries with 15 years time period. have run the…
Merge security daily data and fundamental anualDear Statalist members, I am using a dataset from the WRDS database. I have annual data for my firm …
Subscribe to:
Post Comments (Atom)
0 Response to Dropping Variables Based on Condition and in a Loop
Post a Comment