Defining the constrained segmented distributed lag term
Description
Function employed within the tempeff
formula to specify the variable with a csdl relationship.
The function does not fit the model, it simply returns information exploited by tempeff
to fit a
"modTempEff"
model.
Usage
1 2 
Arguments
z 
the variable, typically the temperature, having the constrained segmented distributed lag parameterization with the response. 
psi 
numeric to provide the starting value for one or two breakpoints of the constrained segmented distributed lag relationship. 
L 
a numerical twolength vector to specify how many lags have to be considered to assess the effect of cold and heat. 
ndx 
apparent dimension (i.e. the rank) of the two Bspline bases for the DL curves
of cold and heat. Default to 
ridge 
a twolength named list of characters to specify the possible ridge penalty to be applied
to DL coefficients. This list has to be named ('cold' and 'heat') and each component has to be
in terms of 
DL 
logical indicating if the difference penalty should be applied to the DL coefficients
or to spline coefficients. Default to spline coefficients ( 
diff.varying 
logical indicating if the difference penalty should be global or depending on the lag value to penalize differences mainly at larger rather than early lags. 
Details
This function has to be used within the formula in tempeff
. It returns information to
fit a constrained segmented distributed lag parameterization within the Poisson regression model
via the function tempeff
.
Value
A list with the temperature variable and the arguments as attributes.
Note
All the arguments of csdl
may be passed via ...
in the call of tempeff
. This feature may
be useful when the same model has to be refitted (via update
) by modifying only one argument
of csdl()
. See tempeff
.
Author(s)
Vito Muggeo
References
Eilers, P., Marx, B. D. (1996). Flexible Smoothing with Bsplines and Penalties Statistical Science 11, 89–121.
Wood, S. N. (2006) Generalized Additive Models: An Introduction with R. Chapman and Hall/CRC Press.
Muggeo, V. M. R. (2008) Modeling temperature effects on mortality: multiple segmented relationships with common break points Biostatistics 9, 613–620.
See Also
tempeff
Examples
1 2 3 4 5 6 7 8 9 10 11 12 13  ## Not run:
# Evaluate temperature effects up to 45 lags for cold and heat and
# a single breakpoint; use 20 as starting value, a global difference
# penalty on spline coefficients and no ridge penalty
csdl(my.temperature,psi=20,L=c(45,45),ridge=NULL)
# Evaluate temperature effects up to 45 lags for cold and 15 lag for
# heat, via Psplines with a global difference penalty on DL coefficients
# and an additional quadratic ridge penalty
csdl(my.temperature,psi=20,L=c(45,15),DL=TRUE,ridge=list(cold="l^2",
heat="l^2"))
## End(Not run)
