excess_cumulative: Compute cumulative excess deaths

Description Usage Arguments Value Examples

View source: R/excess_cumulative.R

Description

This function takes the output of the 'excess_model' function, a start date, and end date and calculates excess mortality and standard errors.

Usage

1

Arguments

fit

The output of 'excess_model'

start

The start date

end

The end date

Value

A data frame with the following columns

date

The date

observed

The observed excess mortality,which is the sum of observed minus expected until that date

sd

The standard deviation for excess mortality for that date if year is typical

fitted

The estimated of excess mortality based on the estimated smooth event effect curve

se

The standard error for 'fitted'

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
data(new_jersey_counts)
exclude_dates <- as.Date("2012-10-29") + 0:180
control_dates <- seq(min(new_jersey_counts$date), min(exclude_dates) - 1, by = "day")
f <- excess_model(new_jersey_counts, 
start = as.Date("2012-09-01"), 
end = as.Date("2013-09-01"),
exclude = exclude_dates,
model = "correlated",
weekday.effect = TRUE,
control.dates = control_dates)

excess_cumulative(f, 
start = as.Date("2017-12-15"), 
end = as.Date("2017-12-21") )

excessmort documentation built on Oct. 11, 2021, 9:06 a.m.