Print and plot methods for surveil model results
# S3 method for surveil
print(x, scale = 1, ...)
# S3 method for surveil
plot(
x,
scale = 1,
style = c("mean_qi", "lines"),
facet = FALSE,
base_size = 14,
palette = "Dark2",
M = 250,
alpha,
lwd,
fill = "gray80",
size = 1.5,
...
)| 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 |
| 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 intervalsl; only used when |
| size | Positive numeric value. For |
The plot method returns a ggplot object; the print method returns nothing but prints a summary of results to the R console.
Connor Donegan (Connor.Donegan@UTSouthwestern.edu)
data(msa)
houston <- msa[grep("Houston", msa$MSA), ]
fit <- stan_rw(houston, time = Year, group = Race, iter = 1500)
print(fit)
## plot probability distribution for disease risk
plot(fit, style = "lines")
plot(fit, facet = TRUE, scale = 100e3)
## as a ggplot, you can customize the output
plot(fit) + theme_bw()