estimate_sar {chainbinomial} | R Documentation |
Estimate Secondary Attack Rate of the Chain Binomial Model
Description
Given data on the number of infected after a number of generation, initial number of susceptible, and initial number of infected, estimate the secondary attack rate (SAR) using maximum likelihood.
Usage
estimate_sar(infected, s0, i0 = 1, generations = Inf, se = TRUE)
Arguments
infected |
numeric. |
s0 |
numeric. |
i0 |
numeric. |
generations |
numeric. |
se |
logical. If TRUE (default), the standard error is computed. |
Value
A list of class sar
with the following components:
-
sar_hat
The point estimate of the secondary attack rate. -
se
Standard error of the estimate (if se = TRUE). -
loglikelihood
The log likelihood value at the point estimate. -
data
The input data.
See Also
confint.sar()
for calculating confidence intervals.
Examples
set.seed(234)
mydata <- rchainbinom(n = 15, s0 = 5, sar = 0.2, i0 = 1, generations = Inf)
res <- estimate_sar(infected = mydata, s0 = 5, i0 = 1, generations = Inf)
[Package chainbinomial version 0.1.5 Index]