asdocx with missings


missings is a community-contributed package written by Nicholas J. Cox. missings is a set of utility commands for managing and reporting variables that may have missing values. By default, “missing” means numeric missing (that is, the system missing value . or one of the extended missing values .a to .z) for numeric variables and empty or “” for string variables.

Users of asdocx have requested the addition of support for missings. Beginning with version 2.2.0, asdocx will now support it, allowing users to export its output table to Word, Excel, LaTeX, or HTML.

How asdocx works with missings

A slightly modified version of the program is available on the asdocx website, which is automatically downloaded when a user first uses it with asdocx. The modification is done to extract only the output matrix from the program and send it to asdocx, no other changes are made1. asdocx captures output from three sub-commands: report, table, and list. However, it does not generate any output from other sub-commands of missings. To use it with asdocx, simply add “asdocx” as a prefix. Here are some examples of how to use it with asdocx.

Missings report

  * Load example dataset
 weuse nlswork, clear
 
 * asdocx with missings
asdocx missings report, replace
Checking missings in all variables: 15082 observations with missing values
Variables missing
age 24
msp 16
nev_mar 16
grade 2
not_smsa 8
c_city 8
south 8
ind_code 341
occ_code 121
union 9296
wks_ue 5704
tenure 433
hours 67
wks_work 703

 

Missings table

  * Table of missing values
 asdocx missings table, replace
Checking missings in all variables: 15082 observations with missing values
# of missing values Freq. Percent Cumulative Freq.
0 13452 47.14 47.14
1 13790 48.33 95.47
2 964 3.38 98.85
3 291 1.02 99.87
4 32 0.11 99.98
5 2 0.01 99.99
6 3 0.01 100.00
Total 28534 100.00
Notes:

 

missings list

  * missings list lists observations with missing values in varlist.
 asdocx missings list, minimum(5) ///
 replace title(Table: List missing with at least 5 missing observations) 
Table: List missing with at least 5 missing observations
age msp nev_mar not_smsa c_city south ind_code occ_code union wks_ue tenure hours wks_work
26 . . 0 1 0 11 8 . . 0.083 40 .
31 . . 0 1 1 7 8 . . 0.333 . .
26 1 0 . . . 7 3 . . 0.083 40 .
32 1 0 1 0 0 . . . . .75 . .
39 0 0 0 1 0 . 3 . . 1.5 . .
Notes:

 

missings options

Option Purpose
numeric Indicates to include numeric variables only. If any string variables are named explicitly, such variables will be ignored.
string Indicates to include string variables only. If any numeric variables are named explicitly, such variables will be ignored.
sysmiss Indicates to include system missing . only. This option has no effect with string variables, for which missing is deemed to be the empty string “”, regardless.
generate(newvar) Specifies the name of a new variable. generate() is required.
observations S(missings report) indicates counting of missing values by observations, not the default of counting by variables.
minimum(#)  (missings report, missings list, and missings table) specifies the minimum number of missings to be shown explicitly. With missings table, the default is minimum(0); otherwise, it is minimum(1).
format(format) (missings report) specifies a display format for percents. The default is format(%5.2f). This option has no effect unless percent is also specified.
percent (missings report) reports percents missing as well as counts. Percents are calculated relative to the number of observations or variables specified.
identify(varlist) or identify(varname) (missings report, missings list, and missings table) insists on showing varlist or varname in the display of results. This can be especially useful to show (for example) identifier variables, which typically will not be missing, or key categorical variables such as education or gender. With missings report, observations and missings list, varlist is included in the list results. With missings table, varname is used to produce a two-way table in contrast to a one-way table; two or more variables may not be specified.
sort(specification)  (missings report) specifies that output be sorted. specification must be either missings or alpha and may also include descending. missings means sorting is done by the number of missing values. alpha means sorting is done by the variable name. Optionally including descending means to sort either the number of missing values or the variable names and display them in descending order; the default is ascending order. For example, sort(missings descending) means the variables with the most missing values will be sorted and shown first.
force Signals that the dataset in memory is being changed and is a required option when data are being dropped and the dataset in memory has not been saved as such.

See also


  • tabmany – Table of multiple coded answers
  • mrtab – One- and two-way tables of multiple responses
  • tabcount – tabulates frequencies for up to 7 variables
  • tab3way – Three way table of frequencies and percentages
  • missings – Various utilities for managing missing values
  • tabulate, tab1, tab2

 

Order asdocx

Yearly license of asdocx is available at $9.99. Its life-time license is available at $49.99. With the asdocx membership, you get :

  • Life-time license to use
  • All future updates
  • All premium templates / plugins.

 

Order asdocx

 

Reference


Cox, N. J. (2015). Speaking Stata: A set of utilities for managing missing values. The Stata Journal, 15(4), 1174-1185.

Acknowledgment
1. We thank Dr Cox for permission to re-use his code and take full responsibility for the effects of any changes made in incorporating that code within asdocx.