wtest: Walter and Elwood's test of seasonality

Description Usage Arguments Details Value Author(s) References Examples

View source: R/wtest.R

Description

Tests for a seasonal pattern in Binomial data.

Usage

1
wtest(cases,offset,data,alpha=0.05)

Arguments

cases

variable name for cases (“successes”).

offset

variable name for at-risk population (“trials”).

data

data frame (optional).

alpha

significance level (default=0.05).

Details

A test of whether monthly data has a sinusoidal seasonal pattern. The test has low power compared with the cosinor test.

Value

test

test statistic.

pvalue

p-value.

Author(s)

Adrian Barnett a.barnett<at>qut.edu.au

References

Walter, S.D., Elwood, J.M. (1975) A test for seasonality of events with a variable population at risk. British Journal of Preventive and Social Medicine 29, 18–21.

Barnett, A.G., Dobson, A.J. (2010) Analysing Seasonal Health Data. Springer.

Examples

1
2
3
4
5
6
7
8
data(stillbirth)
# tabulate the total number of births and the number of stillbirths
freqs<-table(stillbirth$month,stillbirth$stillborn)
data<-list()
data$trials<-as.numeric(freqs[,1]+freqs[,2])
data$success<-as.numeric(freqs[,2])
# test for a seasonal pattern in stillbirth
test<-wtest(cases=success,offset=trials,data=data)

season documentation built on May 2, 2019, 5:22 p.m.