library(serosv)
Proposed model
Two-component mixture model for test result Z with Zj(j={I,S}) being the latent mixing component having density fj(zj|θj) and with πTRUE(a) being the age-dependent mixing probability can be represented as
f(z|zI,zS,a)=(1−πTRUE(a))fS(zS|θS)+πTRUE(a)fI(zI|θI)
The mean E(Z|a) thus equals
μ(a)=(1−πTRUE(a))μS+πTRUE(a)μI
From which the true prevalence can be calculated by
πTRUE(a)=μ(a)−μSμI−μS
Force of infection can then be calculated by
λTRUE=μ′(a)μI−μ(a)
Fitting data
To fit the mixture data, use mixture_model
function
<- vzv_be_2001_2003[vzv_be_2001_2003$age < 40.5,]
df <- df[order(df$age),]
df <- df$VZVmIUml
data <- mixture_model(antibody_level = data)
model $info
model#>
#> Parameters:
#> pi mu sigma
#> 1 0.1088 2.349 0.6804
#> 2 0.8912 6.439 0.9437
#>
#> Distribution:
#> [1] "norm"
#>
#> Constraints:
#> conpi conmu consigma
#> "NONE" "NONE" "NONE"
plot(model)
sero-prevalence and FOI can then be esimated using function
estimate_from_mixture
<- estimate_from_mixture(df$age, data, mixture_model = model, threshold_status = df$seropositive, sp=83, monotonize = FALSE)
est_mixture plot(est_mixture)
#> Warning: No shared levels found between `names(values)` of the manual scale and the
#> data's fill values.