You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
289 B
Plaintext

7 months ago
program define nbmiss
version 8.0
syntax varlist(min=1) [, nbmiss(string)]
if "`nbmiss'"=="" {
local nbmiss nbmiss
}
local nbitems:word count `varlist'
tokenize `varlist'
qui gen `nbmiss'=0
forvalues i=1/`nbitems' {
qui replace `nbmiss'=`nbmiss'+1 if ``i''==.
}
end