File: plot.sir.Rd

package info (click to toggle)
r-cran-popepi 0.4.13%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,656 kB
  • sloc: sh: 13; makefile: 2
file content (85 lines) | stat: -rw-r--r-- 2,190 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/S3_definitions.R
\name{plot.sir}
\alias{plot.sir}
\title{Plot method for sir-object}
\usage{
\method{plot}{sir}(
  x,
  conf.int = TRUE,
  ylab,
  xlab,
  xlim,
  main,
  eps = 0.2,
  abline = TRUE,
  log = FALSE,
  left.margin,
  ...
)
}
\arguments{
\item{x}{an object returned by function \code{sir}}

\item{conf.int}{default TRUE draws confidence intervals}

\item{ylab}{overwrites default y-axis label}

\item{xlab}{overwrites default x-axis label}

\item{xlim}{x-axis minimum and maximum values}

\item{main}{optional plot title}

\item{eps}{error bar vertical bar height (works only in 'model' or 'univariate')}

\item{abline}{logical; draws a grey line in SIR = 1}

\item{log}{logical; SIR is not in log scale by default}

\item{left.margin}{adjust left marginal of the plot to fit long variable names}

\item{...}{arguments passed on to plot(), segment and lines()}
}
\value{
Always returns \code{NULL} invisibly.
This function is called for its side effects.
}
\description{
Plot SIR estimates with error bars
}
\details{
Plot SIR estimates and confidence intervals
\itemize{
\item univariate - plots SIR with univariate confidence intervals
\item model - plots SIR with Poisson modelled confidence intervals
}

\strong{Customize}
Normal plot parameters can be passed to \code{plot}. These can be a vector when plotting error bars:
\itemize{
\item \code{pch} - point type
\item \code{lty} - line type
\item \code{col} - line/point colour
\item \code{lwd} - point/line size
}

\strong{Tips for plotting splines}
It's possible to use \code{plot} to first draw the
confidence intervals using specific line type or colour and then plotting
again the estimate using \code{lines(... , conf.int = FALSE)} with different
settings. This works only when \code{plot.type} is 'splines'.
}
\examples{
\donttest{
# Plot SIR estimates
# plot(sir.by.gender, col = c(4,2), log=FALSE, eps=0.2, lty=1, lwd=2, pch=19,
#      main = 'SIR by gender', abline=TRUE)
}
}
\seealso{
\verb{[sir]},  \verb{[sirspline]}
}
\author{
Matti Rantanen
}