plot.surveil {surveil} | R Documentation |
Methods for fitted surveil
models
Description
Print and plot methods for surveil
model results
Usage
## S3 method for class 'surveil'
print(x, scale = 1, ...)
## S3 method for class 'surveil'
plot(
x,
scale = 1,
style = c("mean_qi", "lines"),
facet = FALSE,
facet_scales = c("fixed", "free"),
ncol = NULL,
base_size = 14,
palette = "Dark2",
M = 250,
alpha,
lwd,
fill = "gray80",
size = 1.5,
...
)
## S3 method for class 'list'
plot(
x,
scale = 1,
style = c("mean_qi", "lines"),
facet = FALSE,
ncol,
facet_scales = c("fixed", "free"),
M = 250,
base_size = 14,
palette = "Dark2",
fill = "gray80",
size = 1.5,
alpha,
lwd,
...
)
Arguments
x |
A fitted |
scale |
Scale the rates by this amount; e.g., |
... |
For the plot method, additional arguments will be passed to ' |
style |
If |
facet |
If |
facet_scales |
When |
ncol |
Number of columns for the plotting device; optional and only used if |
base_size |
Passed to |
palette |
For multiple groups, choose the color palette. For a list of options, see |
M |
If |
alpha |
Numeric value from zero to one. When |
lwd |
Numeric value indicating linewidth. Passed to |
fill |
Color for the shaded credible intervals; only used when |
size |
Positive numeric value. For |
Value
The plot method returns a ggplot
object; the print method returns nothing but prints a summary of results to the R console. If x
is a list of stand_surveil
objects, the plotted lines will be labeled using the names returned by names(x)
; if elements of the list are not named, plotted lines will simply be numbered.
Author(s)
Connor Donegan (Connor.Donegan@UTSouthwestern.edu)
See Also
Examples
data(msa)
dat <- aggregate(cbind(Count, Population) ~ Year + Race, data = msa, FUN = sum)
fit <- stan_rw(dat, time = Year, group = Race,
iter = 1e3, chains = 2) # for speed only, use 4 chains
print(fit)
plot(fit, facet = TRUE, scale = 100e3)
## as a ggplot, you can customize the output
library(ggplot2)
plot(fit) + theme_bw()