modTempEff (version 1.5.2)

plot.modTempEff: Plot method for the class 'modTempEff'

Description

Plots distributed lags curves from the modTempEff fit.

Usage

"plot"(x, which = c("cold", "heat"), add=FALSE, new=TRUE, var.bayes = FALSE, delta.rr = TRUE, level = 0.95, updown=TRUE, col.shade=NULL, leg=NULL, ...)

Arguments

x
object of class "modTempEff".
which
Which DL curve should be plotted? for cold, heat or both of them (default).
add
logical; if TRUE the fitted DL curve for cold or heat is added to an existing plot.
new
logical indicating if a new device should be opened. If add=TRUE, new is set to FALSE.
var.bayes
logical indicating if the 'Bayesian' rather than the frequentist standard errors should be employed to compute the pointwise confidence intervals to be plotted
delta.rr
logical indicating if the DL curves should be plotted on the log scale or as per cent change in relative risk, i.e. 100*(exp(.)-1).
level
the selected confidence level of the pointwise confidence intervals to be plotted
updown
logical; if TRUE the plotting area is split according to par(mfrow=c(2,1)) when both the cold and heat DL curves are drawn.
col.shade
the color of the shaded area representing the pointwise confidence intervals. If NULL no color is used.
leg
the possible legends to be set on the "topright" side of each plot. When both the cold and heat DL curves are drawn it should be a 2-length vector with the first component refering to the plot of cold.
...
additional arguments, such as xlab, ylab, and lwd.

Value

The function simply plots the required estimated DL curve. If the fitted model includes only a smooth term for the long term trend, plot.modTempEff draws it.

Details

Takes a fitted "modTempEff" object produced by tempeff() and plots the DL curves for cold and heat effect with relevant pointwise confidence intervals. plot.modTempEff also works with objects with fixed (not estimated) breakpoint, namely fits returned by tempeff(.., fcontrol=fit.control(it.max=0)). Note add=TRUE makes sense (and works) only for a single (cold or heat) DL curve to be superimposed to an existing plot.

See Also

tempeff

Examples

Run this code
  ## Not run: 
#   #obj is an object returned by tempeff()
#   #plots DL curves for cold and heat with 95% pointwise CI
#   # using frequentist standard errors
#   plot(obj)
#   
#   #plots the estimated DL curve only for heat with 90% pointwise CI
#   # using bayesian standard errors
#   plot(obj, "heat", var.bayes=TRUE, level=.90)
#   ## End(Not run)
  

Run the code above in your browser using DataLab