estEnhanced.Rd
Get enhanced estimate and variance (Bannick and Gao 2023+). This is an estimator similar to the adjusted estimator, but including optional prior HIV test results.
estEnhanced(
n_p,
n,
ptdf,
beta,
beta_var,
big_T,
phidat,
use_geese,
formula,
family,
plot_phi = TRUE,
return_all = FALSE,
...
)
Number of positives
Number of observations
Prior testing data frame. Only include those who are positive.
False recency rate (FRR)
Variance of the estimator for FRR (or 0 if FRR known)
The \(T^*\) in the equation above
Data to fit a modfunc model to. Must have column names ri for recency indicator and ui for infection duration. Can have more columns, e.g., if an id is needed for geese.
Indicator to fit a gee model using geese(), or a glm model with glm()
Formula for fitting the model to phidat. Formula argument must take in only ui as the newdata. For example, do not create a ui^2 variable. Use poly(ui, ...) function to fit polynomial terms.
Family argument for glm or gee
Whether to plot the estimated phi function
Return information to be used internally (not for general usage)
Returns a list of the estimate and the variance, or more:
incidence estimate
estimate of variance
estimate of MDRI using phidat
and model specs
estimate of variance of MDRI using phidat
and model specs
number of recent infections identified based on recency assay alone, from ptdf
number of recent infections after applying enhanced algorithm using prior tests
number of HIV-pos individuals with recency assay results + prior tests / recency assay results
fraction of HIV-pos individuals with recency assay results / HIV-pos individuals
For example of usage, see the enhanced estimator vignette("enhanced", package = "XSRecency")