Defining the constrained segmented distributed lag term
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
the variable, typically the temperature, having the constrained segmented distributed lag parameterization with the response.
numeric to provide the starting value for one or two breakpoints of the constrained segmented distributed lag relationship.
a numerical two-length vector to specify how many lags have to be considered to assess the effect of cold and heat.
apparent dimension (i.e. the rank) of the two B-spline bases for the DL curves
of cold and heat. Default to
a two-length 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
logical indicating if the difference penalty should be applied to the DL coefficients
or to spline coefficients. Default to spline coefficients (
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.
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
A list with the temperature variable and the arguments as attributes.
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 re-fitted (via
update) by modifying only one argument
Eilers, P., Marx, B. D. (1996). Flexible Smoothing with B-splines 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.
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 P-splines 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)
Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.