help for xtmiss

Report Missing Observations of Individual and Time variables in Panel Data

xtmiss report missing observations of individual and time variables in panel data.

Syntax

xtmiss [if] [in] , id(varlist) time(varlist) [ both punct(parse_strings)
join(parse_strings) exist keep ascending descending nolist ]

id(varlist) defines the individual variable(s) (or the panel variable).

time(varlist) defines the time variable(s) (or the grouping variable).

both is optional, also reports on missing observations of time variable. The default is only reporting on individual variable(s).

punct(parse_strings) is optional, specifies strings to concatenate variables in id(varlist) and time(varlist); See function concat() in egen for details.

join(parse_strings) is optional, specifies strings to concatenate missing elements in id(varlist) and time(varlist). The default is join(;).

exist is optional, generates a new variable on the number of existing individual and time variable(s); should set with option keep.

keep is optional, generates new variables on missing situations of individual and time variables.

ascending is optional, displays rows in ascending order of the number of missing observations of individual (or time) variables.

descending is optional, displays rows in descending order of the number of missing observations of individual (or time) variables.

nolist is optional, doesn't displays the results of missing situations. It is invalid if option keep is not set.

list_options are optional, are any options available for list.

*** Important Notes:

1. Both options id(varlist) and time(varlist) allow setting multiple variables with different types;

2. The option ascending or descending should be set at most one, and will be invalid if option nolist is set;

3. If the option keep is set, the command xtmiss may generate the following variables:

Id_Miss, Id_Total, Id_MProp, Id_MissElm ;

Id_Var, Time_Var (not keep) ;

Id_Exist, Time_Exist (if option exist is set);

Time_Miss, Time_Total, Time_MProp, Time_MissElm (if option both is set).

Examples

. xtmiss , id(prov) time(year)

. xtmiss , id(prov) time(year) both

. xtmiss , id(prov) time(year) keep

. xtmiss , id(prov) time(year) both keep

. xtmiss , id(prov) time(year) ascending

. xtmiss , id(prov) time(year) both descending

. xtmiss , id(prov) time(year) nolist keep

. xtmiss , id(prov) time(year) exist keep

. xtmiss , id(prov) time(year) join(,)

. xtmiss , id(prov city) time(year)

. xtmiss , id(prov city) time(year) punct(-)

. xtmiss , id(prov city) time(year month)

. xtmiss , id(prov city) time(year month) both

. xtmiss , id(city) time(year month) both keep

. xtmiss if inrange(year,2003,2022) , id(prov) time(year)

. xtmiss , id(prov) time(year) notrim

. return list

Returned Values

r(Idvars) the list of the individual variable(s).

r(Timevars) the list of the time variable(s).

r(missing_num) the number of missing observations in the current data.

r(exist_num) the number of existing observations in the current data.

r(balance_num) the number of total observations if the current data is balanced.

Authors

Dejin Xie, School of Economics and Management, Nanchang University, China.

E-mail: xiedejin@ncu.edu.cn.

Also see

Help: xtdescribe, egen, gsort; stvarag, xtmis,
xtpattern, xtbalance, missings (if they are installed).