# Survival probability for RITA Screening

`diagnosis_survival.Rd`

Survival probability for RITA Screening

## Usage

```
diagnosis_survival(
undiagnosed,
tslt,
ever_hiv_test,
hiv,
weights,
n = 365 * 5,
population = c("undiagnosed", "negative")
)
```

## Arguments

- undiagnosed
A logical vector indicating if an individual has never been diagnosed as HIV+.

- tslt
Time since last test in days

- ever_hiv_test
A logical vector indicating whether an individual has ever had an HIV test

- hiv
HIV positive status.

- weights
Survey weights

- n
Number of days to calculate

- population
If undiagnosed, the testing histories of undiagnosed HIV+ people are used. If negative, the HIV- population is used.

## Value

A vector where the ith element is the probability that an individual infected i days ago has not been diagnosed.

## Examples

```
data("assay_data")
diagnosis_survival(
assay_data$undiagnosed,
assay_data$tslt,
assay_data$ever_hiv_test,
assay_data$hiv,
assay_data$weights,
n=40)
#> [1] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 0.9999999 0.9856229
#> [8] 0.9645352 0.9645352 0.9645351 0.9645351 0.9645350 0.9645349 0.9645348
#> [15] 0.9645347 0.9645346 0.9645345 0.9645343 0.9645342 0.9645340 0.9645338
#> [22] 0.9645336 0.9645334 0.9645332 0.9645330 0.9578763 0.9461989 0.9361930
#> [29] 0.9329834 0.9329831 0.9329828 0.9122144 0.9063568 0.8961050 0.8788440
#> [36] 0.8743504 0.8708172 0.8708168 0.8615339 0.8615335
```