p.control {modTempEff}R Documentation

Auxiliary function to control the P-spline fit for distributed lags

Description

Auxiliary function to detail the options concerning the P-splines employed to smooth the distributed lags (DL) curves of cold and heat.

Usage

p.control(DL = FALSE, diff.varying = FALSE, 
  ridge.formulas = list(cold = "xlag^2", heat = "xlag^2"))

Arguments

DL logical indicating if the difference penalty should be applied to the DL coefficients or spline coefficients. Default to spline coefficients (DL=FALSE)
diff.varying logical indicating if the difference penalty should be global or depending on the lag, i.e. to penalize differences mainly at longer lags.
ridge.formulas 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 "xlag". See examples below.

Details

DL curves are estimated via P-splines, namely B-spline basis with some penalty on coefficients to guarantee smoothness. The difference penalty ensures smooth curve over the lag range and the possible ridge penalty allows the DL curve approaching to zero at longer lags.

Value

A list with the arguments as components to be used by 'tempeff' or 'tempeff.fit'.

Author(s)

Vito Muggeo

References

Eilers, P., Marx, B. (1996). Flexible Smoothing with B-splines and Penalties Statistical Science 11, 89–121.

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

## Not run: 
#P-spline fit with a global difference penalty on DL coefficients and 
#an additional quadratic ridge penalty
p.control(DL=FALSE,diff.varying=FALSE,
  ridge.formulas=list(cold="xlag^2",heat="xlag^2"))

#P-spline fit with a global difference penalty of the DL coefficients 
#without ridge penalty
p.control(DL=TRUE,diff.varying=FALSE,ridge.formulas=NA)
## End(Not run)

[Package modTempEff version 1.1 Index]