modTempEff (version 1.5.2)

tempeff: Modelling temperature effects on mortality

Description

Fits the constrained segmented distributed lag log-linear regression model to daily time series data of mortality and temperature and additional confounding factors.

Usage

tempeff(formula, data, subset, na.action, fcontrol = fit.control(), etastart = NULL, drop.L, ...)

Arguments

formula
the model formula such as `response ~ parametric terms + csdl(temperature) + seas(day)', see details.
data
the dataset where the variables are stored.
subset
an optional vector specifying a subset of observations to be used.
na.action
a function to indicate how to handle NA observations.
fcontrol
a list with components returned by fit.control().
etastart
possible starting values on the scale of the linear predictor.
drop.L
integer, specifying whether the first `drop.L' observations should be removed before fitting. This is useful for model comparison purposes, see notes.
...
additional arguments to be passed to csdl() in the formula, see details.

Value

The function returns an object of class "modTempEff". It is the list returned by gam.fit of package mgcv with the additional components
psi
The estimated breakpoint with corresponding standard error (bayesian and frequentist).
betaCold
The estimated DL coefficients for the cold effect.
SE.c
The frequentist standard errors of the cold DL estimates.
SE.c.bayes
The bayesian standard errors of the cold DL estimates.
ToTcold
Estimate and frequentist standard error of the total (net) effect of cold.
ToTcold.bayes
Estimate and bayesian standard error of the total (net) effect of cold.
edf.cold
The df associated at each spline coefficient of the DL curve of cold.
rank.cold
The apparent dimension of the B-spline basis of the DL for cold.
betaHeat
The estimated DL coefficients for the heat effect.
SE.h
The frequentist standard errors of the heat DL estimates.
SE.h.bayes
The bayesian standard errors of the heat DL estimates.
ToTheat
Estimate and frequentist standard error of the total (net) effect of heat.
ToTheat.bayes
Estimate and bayesian standard error of the total (net) effect of heat.
edf.heat
The df associated at each spline coefficient of the DL curve of heat.
rank.heat
The apparent dimension of the B-spline basis of the DL for heat.
rank.seas
When ndx.seas>0, the apparent dimension of the B-spline basis for seasonality.
edf.seas
When ndx.seas>0, the df associated at spline coefficients of seasonality.
fit.seas
When ndx.seas>0, the fitted long-term trend (on the log scale).

Details

The function fits a log-linear regression model to assess the effects of temperature on mortality using a `constrained segmented distributed lag parameterization' (csdl). It is assumed that the data are daily time series of mortality (or perhaps morbidity) and temperature. The left hand side of the formula includes the response (daily counts), and the right hand side may include one or more of the following
  • linear confounders (such as influenza epidemics or day-of-week);
  • nonparametric long term trend, via the function seas;
  • the csdl effect of temperature via the function csdl.

All the arguments of csdl() may be passed via ... directly in the call of tempeff. This may facilitate the user when different models have to be fitted by changing only some of (and not all) the arguments of csdl(). See the example below.

References

Muggeo, V.M.R. (2008) Modeling temperature effects on mortality: multiple segmented relationships with common break points Biostatistics 9, 613--620.

Muggeo, V.M.R. (2009) Analyzing Temperature Effects on Mortality Within the R Environment: The Constrained Segmented Distributed Lag Parameterization Journal of Statistical Software, 32 12, 1--17.

See Also

modTempEff-package, plot.modTempEff, summary.modTempEff, gam.fit in package mgcv

Examples

Run this code
## Not run: 
# library(modTempEff)
# data(dataDeathTemp)
# o1<-tempeff(dec1~day+factor(dweek)+factor(year)+factor(month)+
#       csdl(mtemp,L=c(60,60),psi=20),
#       data=dataDeathTemp, fcontrol = fit.control(display=TRUE))
# 
# #add a ridge penalty: note how you *can* specify ridge!
# #you do NOT need to use csdl(..,ridge=..) 
# o2<-update(o1, ridge=list(cold="l^2", heat="l^2"))
# 
# #a model without temperature effects (the first drop.L obs are dropped)
# o3<-tempeff(dec1~day+factor(dweek)+factor(year)+factor(month),
#       data=dataset,drop.L=60)
# 
# #see ?anova.modTempEff for model comparisons
# ## End(Not run)

Run the code above in your browser using DataLab