serosv
is an easy-to-use and efficient tool to estimate
infectious diseases parameters (seroprevalence and force of infection)
using serological data. The current version is based on the book
“Modeling Infectious Disease Parameters Based on Serological and Social
Contact Data – A Modern Statistical Perspective” by Hens et
al., 2012 Springer.
You can install the development version of serosv with:
# install.packages("devtools")
::install_github("OUCRU-Modelling/serosv") devtools
serosv
contains 15 built-in serological datasets as
provided by Hens et
al., 2012 Springer. Simply call the name to load a dataset, for
example:
<- rubella_uk_1986_1987 rubella
The following methods are available to estimate seroprevalence and force of infection.
Parametric approaches:
Nonparametric approaches:
Load the rubella in UK dataset.
library(serosv)
Find the power for the best second degree fractional polynomial with monotonicity constraint and a logit link function. The power appears to be (-0.9,-0.9).
<- rubella_uk_1986_1987
rubella
<- find_best_fp_powers(
best_2d_mn $age, rubella$pos, rubella$tot,
rubellap=seq(-2,3,0.1), mc = T, degree=2, link="logit"
)
best_2d_mn#> $p
#> [1] -0.9 -0.9
#>
#> $deviance
#> [1] 37.57966
#>
#> $model
#>
#> Call: glm(formula = as.formula(formulate(p_cur)), family = binomial(link = link))
#>
#> Coefficients:
#> (Intercept) I(age^-0.9)
#> 4.342 -4.696
#> I(I(age^-0.9) * log(age))
#> -9.845
#>
#> Degrees of Freedom: 43 Total (i.e. Null); 41 Residual
#> Null Deviance: 1369
#> Residual Deviance: 37.58 AIC: 210.1
Finally, fit the second degree fractional polynomial.
<- fp_model(
fpmd $age, rubella$pos, rubella$tot,
rubellap=c(-0.9, -0.9), link="logit")
plot(fpmd)