{smcl}
{* 17may2005}{...}
{hline}
help for {hi:seast}{right:(SJ 5-3: sg149_1; STB-56: sg149)}
{hline}


{title:Tests for seasonality with a variable population at risk}

{p 8 17 2} 
{cmd:seast}
{it:outcomevar}
[{it:popvar}] 
[{cmd:,} 
{cmdab:ex:act}
{cmdab:not:ab}
{cmdab:g:enerate(}{it:newvar}{cmd:)}
{cmdab:sec:tor(}{it:varname}{cmd:)} 
{cmdab:len:gth(}{it:varname}{cmd:)} ]

{p 4 4 2}
{cmd:sector()} is required when the name of the sector variable is not
{cmd:month}.

	   
{title:Description} 

{p 4 4 2} 
{cmd:seast} tests for seasonality of a binary outcome with a variable
population at risk.  Two tests are available: the Edwards test and the
Walter and Elwood test.  Both are preferred to the chi-square test because
the ordered structure of the data is taken into account.

{p 4 4 2}
When an adjustment for a varying population at risk needs to be made, i.e.
when {it:popvar} is specified, then the Walter and Elwood test is performed
on a sector variable called {cmd:month}.  Otherwise the sector variable
should be declared.  Months should be denoted by 1,2,...,12, where month 1
corresponds to January, etc.  The default model takes no account of the
differing lengths of month.  An option is available whereby the number of
days in a standard month from the Gregorian calendar is used.

{p 4 4 2} 
When there is no varying population to be accounted for, and {it:popvar} is
not specified, the Edwards test is used.

{p 4 4 2}
By default there are 12 sectors, the sector variable is called {cmd:month},
and each month is the same length.

{p 4 4 2}
Both tests consider observations in each sector (month) arising as moments
around a unit circle, with the data corresponding to sector mid-points.  


{title:Options}

{p 4 8 2} 
{cmd:exact} forces the test to adjust for variable month length.  This is
used when the sector has not been specified as the data consist of 12
months.  The option sets each month length to be as used by the Gregorian
calendar (28.25 days in the case of February).  {cmd:exact} need not be
specified when {cmd:length()} is specified. 

{p 4 8 2} 
{cmd:notab} suppresses the display of a table of observed and expected
numbers of events by sector.

{p 4 8 2}
{cmd:generate()} generates a new variable containing the expected number of
events for each sector. This may be useful for graphing the data, or for
further calculations.

{p 4 8 2} 
{cmd:length()} declares the name of the variable containing the lengths of
sectors. For example, if the sectors were the second 6 months of the year
the length variable should contain the number of days in each of those
months, i.e. 31,31,30,31,30,31. If {cmd:length()} is specified the test will
take account of varying length of sectors.

{p 4 8 2}
{cmd:sector()} declares the name of the variable denoting the sector. Values
should be numbered sequentially from 1 up.  If the number of sectors is 12,
it is assumed that  sectors 1,..,12 correspond to January,...,December.


{title:Examples}

{p 4 8 2}{cmd:. seast cases births}{p_end}
{p 4 8 2}{cmd:. seast cases births, gen(exp) exact}{p_end}
{p 4 8 2}{cmd:. seast cases births, sector(quarter) length(qlength)}{p_end}


{title:References}

{p 4 4 2}Edwards, J.H. 1961. The recognition and estimation of cyclic trends. 
{it:Annals of Human Genetics} 25: 83{c -}86.

{p 4 4 2}Walter, S.D. and J.M. Elwood. 1975.  
A test for the seasonality of events with a variable population at risk. 
{it:British Journal of Preventative and Social Medicine} 29: 18{c -}21.


{title:Acknowledgements}

{p 4 4 2} 
This version fixes a bug in conversion of results to angles 
specifying time of year. We are grateful to Darren Greenwood for 
helpful advice.


{title:Authors} 

{p 4 4 2}Mark S. Pearce{break} 
         School of Clinical Medical Sciences, University of Newcastle{break} 
	 m.s.pearce@ncl.ac.uk

{p 4 4 2}Richard G. Feltbower{break} 
	 Paediatric Epidemiology Group, University of Leeds{break} 
	 r.g.feltbower@leeds.ac.uk 

