{smcl}
{* 25Jun2002}{...}
{hline}
help for {hi:xtab}{right:(author:  {hi:Tony Brady})}
{hline}

{title:Tabulate longitudinal data}

{p 8 17}{cmd:xtab} {it:varname}
	    [{cmd:,} {cmd:i(}{it:varname}{cmd:)} {cmd:t(}{it:varname}{cmd:)} {cmdab:m:issing}
	    {cmdab:occ:asion(}{cmdab:e:ver} | {cmdab:n:ever} | {cmdab:f:irst} | {cmdab:l:ast} | {cmd:_N} |
	    {it:#} {cmd:)} ]

{p}{cmd:by} {it:...} {cmd::} may be used with the above command;
see help {help by}.


{title:Description}

{p}If you have not read help for {help xt}, please do so now.

{p}{cmd:xtab}, a generalization of {help tabulate}, performs one-way
tabulations of cross-sectional time-series (xt) data. It is more
flexible than {help xttab}, allowing several choices of the occasion
within cluster to tabulate.


{title:Options}

{p 0 4}{cmd:i(}{it:varname}{cmd:)} specifies the variable name corresponding to
i; see help {help xt}.

{p 0 4}{cmd:t(}{it:varname}{cmd:)} specifies the variable name corresponding to
t; see help {help xt}.

{p 0 4}{cmd:missing} requests that missing values be treated like other values in
calculations of counts and percentages.

{p 0 4}{cmd:occasion({it:occ})} determines which observations within cluster i are to be used
in the tabulation. {it:occ} must be one of:

{p 8 22}{cmdab:e:ver}{space 10}means clusters are characterised by values appearing in any valid observation
within the cluster; the default.{p_end}
{p 8 22}{cmdab:n:ever}{space 9}tabulates the number of clusters that do not contain the value in any valid observation.{p_end}
{p 4 22}(*) {cmdab:f:irst} or {cmd:1}{space 4}uses the first valid observation to characterise clusters.{p_end}
{p 4 22}(*) {cmdab:l:ast} or {cmd:_N}{space 4}uses the last valid observation to characterise clusters.{p_end}
{p 4 22}(*) {it:#}{space 13}requests the observation on occasion {it:#} within each cluster to be used in the tabulation.{p_end}

{p} Unstarred occasions do not require the time variable t to be defined whereas starred occasions do.


{title:Examples}

{p 8 12}{inp:. xtab beta, i(idnum)}{p_end}
{p 8 12}{inp:. xtab beta, i(idnum) t(date) occ(last) miss}{p_end}

{p 8 12}{inp:. iis idnum}{p_end}
{p 8 12}{inp:. tis date}{p_end}
{p 8 12}{inp:. xtab beta, occ(2)}{p_end}

{p 8 12}{inp:. bysort region: xtab aspirin, occ(never)}{p_end}


{title:Author}

{p 8 12}Tony Brady, {browse "http://www.sealedenvelope.com/":Sealed Envelope Ltd}, U.K.{p_end}
{p 8 12}{browse "mailto:tony@sealedenvelope.com?subject=xtab.ado":tony@sealedenvelope.com}


{title:Also see}

{p 1 14}Manual:  {hi:[R] xt}{p_end}
{p 0 19}On-line:  help for {help xt}, {help xttab}, {help xtdes}, {help xtsum}{p_end}
