Learn R Programming

glarma (version 1.7-1)

Asthma: Daily Presentations of Asthma at Campbelltown Hospital

Description

The data arose from a single hospital (at Campbelltown) as part of a larger (ongoing) study into the relationship between atmospheric pollution and the number of asthma cases presenting themselves to various emergency departments in local hospitals in the South West region of Sydney, Australia.

Usage

data(Asthma)

Arguments

Format

A data frame containing the following columns:

[, 1]CountDaily counts of asthma at Campbelltown Hospital.
[, 2]InterceptA vector of ones, providing the intercept in the model.
[, 3]SundayTakes value one for Sundays, otherwise zero.
[, 4]MondayTakes value one for Mondays, otherwise zero.
[, 5]CosAnnualcos((2*pi*t)/365), annual cosine term.
[, 6]SinAnnualsin((2*pi*t)/365), annual sine term.
[, 7]H7Scaled lagged and smoothed humidity variable.
[, 8]NO2maxMaximum daily nitrogen dioxide.
[, 9:16]T1.1990 - T2.1993Smooth shapes to capture school terms in each year.

Examples

Run this code
### Example with asthma data
data(Asthma)
y <- Asthma[,1]
X <- as.matrix(Asthma[,2:16])

## Model in Davis, Dunsmuir and Streett (2003)

## MA(7) specification - see Davis, Dunsmuir and Streett (2003)

## Pearson Residuals, Fisher Scoring
glarmamod <- glarma(y, X, thetaLags = 7, type = "Poi", method = "FS",
                    residuals = "Pearson", maxit = 100, grad = 1e-6)
glarmamod
summary(glarmamod)

likTests(glarmamod)
plot.glarma(glarmamod)

if (FALSE) {
## Example is specified as \dontrun because it takes too long
## for package inclusion on CRAN

## Pearson Residuals, Newton Raphson, Negative Binomial
## Initial value of the shape parameter take to be zero
glarmamod <- glarma(y, X, thetaLags = 7, type = "NegBin", method = "NR",
                    residuals = "Pearson", alphaInit = 0,
                    maxit = 100, grad = 1e-6)
glarmamod
summary(glarmamod)

likTests(glarmamod)
plot.glarma(glarmamod)
}

Run the code above in your browser using DataLab