% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/retro_summary.r
\docType{methods}
\name{retro_summary}
\alias{retro_summary}
\alias{retro_summary,syndromicD-method}
\alias{retro_summary,syndromicW-method}
\title{\code{retro_summary}}
\usage{
retro_summary(x, ...)

\S4method{retro_summary}{syndromicD}(x, object.name = "my.syndromic",
  file.name = "syndromic.retro.summary", frequency = 365, short = FALSE)

\S4method{retro_summary}{syndromicW}(x, object.name = "my.syndromic",
  file.name = "syndromic.retro.summary", frequency = 52, short = FALSE)
}
\arguments{
\item{x}{a syndromic (\code{syndromicD} or \code{syndromicW}) object, 
from where dates and observed
data will be extracted.}

\item{...}{Additional arguments to the method.}

\item{object.name}{a name for the title in the html file, by default
"my.syndromic".}

\item{file.name}{a name for the rmd/html file to be created with
the summary. The default is "syndromic.retro.summary". When changing the
file name remember to use quotes. Please note that the function will create
a subdirectory within the current working directory, where all files will be
saved. Make sure to check the current working directory (\code{getwd()}) and
set a convenient one if needed (\code{setwd()}). See examples.}

\item{frequency}{The cycle of data repetition. By default equal to 365 (year)
for objects of the class \code{syndromicD} and 52 weeks for objects of the
class \code{syndromicW}. For DAILY data without weekends, for instance, 
it should be set to 260.}

\item{short}{By default set to FALSE. When set to TRUE, omits the
fitting of poisson and negative binomial distributions, displaying only
summary statistics and plots for each series.}
}
\value{
A ".Rmd" file and a ".html" page with sections corresponding to each syndromic group
found in the slot observed of the syndromic object. These include:
\itemize{
  \item{daily and weekly plots}{
    Line plots of the data found in the slot observed of the syndromic
    object provided. In the case of daily data, 
    Weekly plots are produced merging the daily data by week.
  }

  \item{basic summary statistics}{
    Such as mean, quartiles, auto-correlation and partial auto-correlation.
  }

  \item{box-plots}{
    of the data by day-of-week, month and year, intended to allow a
    preliminary assessment of which temporal effects are present (day-of-week,
    seasonal or trends). Plots vary depending on whether the data provided is monitored daily
    (\code{syndromicD}) or weekly (\code{syndromicW})
  }

  \item{Poisson model fitting}{
    Fitting of a Poisson model to the data using a formula specified by the user.
  }

  \item{Negative Binomial model fitting}{
    Fitting of a negative binomial model to the data using a formula specified by the user.
  }

}
}
\description{
Performs an exploratory, descriptive analysis of the time series of observed
data, for as many syndromic groups as under study, and outputs both a
markdown file, where the user can have access to all retrospective
analysis R codes, and an html summary (produced by knitting the .Rmd file).
}
\details{
The summary should constitue a first step in the retrospective
exploratory analysis of available syndromic data. It is also intended to
serve as means to check the result of the creation
of an object of the class syndromic (\code{syndromicD} or 
\code{syndromicW}). That is, it is a convenient, fast
way to plot all syndromic time-series in the object.

If the user wants to make changes to the summary produced, it is easy
to open the .Rmd file in RStudio and produce any changes to the R
code generated.
}
\examples{
data(lab.daily)
my.syndromicD <- raw_to_syndromicD (id=SubmissionID,
                                  syndromes.var=Syndrome,
                                  dates.var=DateofSubmission,
                                  date.format="\%d/\%m/\%Y",
                                  data=lab.daily)
retro_summary(my.syndromicD)


my.syndromicD <- raw_to_syndromicD (id=lab.daily$SubmissionID,
                                 syndromes.var=lab.daily$Syndrome,
                                 dates.var=lab.daily$DateofSubmission,
                                 date.format="\%d/\%m/\%Y")
wd = getwd()
setwd(paste0(wd,"/retro"))
retro_summary(my.syndromicD)
setwd(wd)

### WEEKLY
data(lab.daily)
my.syndromicW <- raw_to_syndromicW (id=SubmissionID,
                                  syndromes.var=Syndrome,
                                  dates.var=DateofSubmission,
                                  date.format="\%d/\%m/\%Y",
                                  data=lab.daily)
retro_summary(my.syndromicW)


my.syndromicW <- raw_to_syndromicW (id=lab.daily$SubmissionID,
                                 syndromes.var=lab.daily$Syndrome,
                                 dates.var=lab.daily$DateofSubmission,
                                 date.format="\%d/\%m/\%Y")
wd = getwd()
setwd(paste0(wd,"/retro"))
retro_summary(my.syndromicW)
setwd(wd)

}
\keyword{methods}
