## ----include = FALSE----------------------------------------------------------
knitr::opts_chunk$set(collapse = TRUE, comment = "#>", fig.width = 7, fig.height = 4.2)

## -----------------------------------------------------------------------------
library(eventsurvey)

## ----coverage-----------------------------------------------------------------
fit_preview <- eventsurvey(y ~ day, sample_data)
plot(fit_preview, type = "daily")

## -----------------------------------------------------------------------------
fit <- eventsurvey(y ~ day, sample_data)
summary(fit)

## -----------------------------------------------------------------------------
fit$estimate
head(fit$days)
head(fit$reference)
head(fit$windows)

## ----counterfactual-----------------------------------------------------------
plot(fit)

## ----diagnostics--------------------------------------------------------------
plot(fit, type = "diagnostics")

