Hello everyone,
I'm asking how can I replace the value of a specific cell with the number of the row in a loop command
I've created a loop command to drop variables with missing values over than 20, and I want to count those variables that are dropped by generating a value called "missing_values" that supposed to have specific cells changing over the looping process.
Example:
foreach var of varlist ..... {
count if missing(`var')
if r(N)>20 drop `var'
replace missing_values=_n in (_n/_N)
}
Any help?
I'm asking how can I replace the value of a specific cell with the number of the row in a loop command
I've created a loop command to drop variables with missing values over than 20, and I want to count those variables that are dropped by generating a value called "missing_values" that supposed to have specific cells changing over the looping process.
Example:
foreach var of varlist ..... {
count if missing(`var')
if r(N)>20 drop `var'
replace missing_values=_n in (_n/_N)
}
Any help?
Comment