*! version 1.1.7 15dec2022

Title

statmis -- Statistics of missing values

Syntax

statmis [varlist] [if] [in], [excluded nst(string)]

excluded exclude variables; obtain results for all variables except those of varlist

generate(newvar) name of new variable to count missing values; default is _NMiss

nogenerate do not create _NMiss variable

noreport do not display detailed mising statistics table

nst(string) name of the study (label)

Description

Statistics of missing values.

If asked, this command adds an auxiliary variable (named _NMiss by default) to the dataset. If a variable with this name
already exists, it is overwritten. This variable allows to identify and/or drop observations with missing values,
as it contains the number of missing values for each observation for the given variables.

Not applicable values previously coded as .z are excluded from the missing group.

By default all the variables in the dataset are used.

You can click here to pop up a dialog or type db statmis.

Execute net from http://metodo.uab.cat/stata for install.

It is important to keep the commands updated. Execute adoupdate statmis, update to update the statmis command.

Execute adoupdate, update to update all the user-written commands.

This command uses the summarize and tabulate Stata commands.

If you find any bugs or want to suggest any improvements, please send an e-mail to: leam@uab.cat.

Examples

. use http://metodo.uab.cat/stata/Salud.dta

. statmis

. statmis Sexo HabitFum PTc IMC Edad HTA

. statmis HabitFum EdadF Tab CIE, noreport generate(miss)

. statmis PAS PAD H1 - NivObs, nogenerate excluded

Stored results

Unless noreport option is especified, the command stores the following scalars in r():

r(nsysmis) total number of sysmis values

r(nuser) total number of user-missing values

r(nmissing) total number of missing values

r(pmissing) total percent of missing values

r(na) total number of not applicable values

r(nvalid) total number of valid values

r(pvalid) total percent of valid values

Version

Version 1.1.7 -- 15 December 2022

Authors

JM.Doménech

Programmer: R.Sesma

Laboratori d'Estadística Aplicada

Universitat Autònoma de Barcelona

leam@uab.cat

Vancouver reference

Doménech JM. Statistics of missing values: User-written command statmis for Stata [computer program].

V1.1.7. Bellaterra: Universitat Autònoma de Barcelona; 2022.

Available executing from Stata: net from http://metodo.uab.cat/stata