| cbmod {chainbinomial} | R Documentation |
Fitting models for Secondary Attack Rate with Chain Binomial response
Description
Fitting models for Secondary Attack Rate with Chain Binomial response
Usage
cbmod(
y,
s0,
x = NULL,
i0 = 1,
generations = Inf,
link = "identity",
optim_method = "BFGS"
)
Arguments
y |
numeric, the number of infected cases. |
s0 |
numeric, the number of initial susceptibles. |
x |
matrix of predictors (design matrix). |
i0 |
numeric, number of initial infected. Default is 1. |
generations |
numeric. |
link |
Link function. Default is 'identity'. |
optim_method |
Optimization method used by optim. |
Details
The following link functions are available: identity, log, logit, and cloglog.
Value
A list of class cbmod with the following components:
-
parametersThe point estimate of the regression coefficients. -
seStandard error of the regression coefficient estimates. -
vcovVariance-Covariance matrix of the regression coefficient estimates. -
p_valuesP-values of the null hypothesis that the regression regression coefficient estimate is 0. -
loglikelihoodthe log likelihood value at the point estimate. -
nparNumber of parameters. -
sar_hatVector of fitted secondary attack rates. -
fitted_valuesVector of expected outbreak size (final attack rate). -
linkLink function used by the regression model. -
null_model= Null model, fitted withestimate_sar(). This is equivalent to an intercept only model. -
warningsWarning_messages, -
est_time: Time used to fit the model. -
omitted_valuesVector indicating data points that were ignored during estimation because of missing values.
See Also
Methods for cbmod objects:
Examples
set.seed(234)
mydata <- data.frame(infected = rchainbinom(n = 15, s0 = 5, sar = 0.2,
i0 = 1, generations = Inf),
s0 = 5, i0 = 1, generations = Inf)
xmat <- model.matrix(~ 1, data = mydata)
res <- cbmod(y = mydata$infected, s0 = mydata$s0, x = xmat, i0 = mydata$i0,
generations = mydata$generations)
summary(res)