monthglm {season}R Documentation

Fit a GLM with month

Description

Fit a generalized linear model with a categorical independent variable of month.

Usage

monthglm(formula,data,family=gaussian(),refmonth=1,offsetmonth=FALSE,
offsetpop=NULL) 
## S3 method for class 'monthglm':
print(x, ...)

Arguments

formula regression model formula, e.g., y~x1+x2, (do not add month to the regression equation, it will be added automatically).
data a data frame.
family a description of the error distribution and link function to be used in the model (default=gaussian()). (See family for details of family functions.).
refmonth reference month, must be between 1 and 12 (default=1 for January).
offsetmonth include an offset to account for the uneven number of days in the month (TRUE/FALSE). Should be used for monthly counts (with family=poisson()).
offsetpop include an offset for the population (optional), this should be a variable in the data frame. Do not log-transform the offset as the log-transform is applied by the function.
x Object of class monthglm
... further arguments passed to or from other methods.

Details

Month is fitted as an independent variable as part of a generalized linear model. Other independent variables can be added to the right-hand side of formula.

This model is useful for examining non-sinusoidal seasonal patterns. For sinusoidal seasonal patterns see cosinor.

The data frame should contain the integer months in a variable called ‘month’.

Value

call the original call to the monthglm function.
fit GLM model.
fitted fitted values.
residuals residuals.
out details on the monthly estimates.

Author(s)

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

References

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

See Also

summary.monthglm, plot.monthglm

Examples

data(CVD)
mmodel<-monthglm(formula=cvd~1,data=CVD,family=poisson(),
offsetpop=pop/100000,offsetmonth=TRUE)

[Package season version 0.2-3 Index]