https://github.com/chstock/dtcompair
Comparison of Binary Diagnostic Tests in a Paired Study Design
https://github.com/chstock/dtcompair
clinical-epidemiology comparative-analysis cran diagnosis diagnostic-accuracy-studies diagnostic-likelihood-ratio diagnostic-tests medicine predictive-value r r-package sensitivity specificity
Last synced: about 2 months ago
JSON representation
Comparison of Binary Diagnostic Tests in a Paired Study Design
- Host: GitHub
- URL: https://github.com/chstock/dtcompair
- Owner: chstock
- Created: 2023-01-28T20:09:29.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-07T13:16:05.000Z (about 1 year ago)
- Last Synced: 2025-07-17T22:14:02.155Z (3 months ago)
- Topics: clinical-epidemiology, comparative-analysis, cran, diagnosis, diagnostic-accuracy-studies, diagnostic-likelihood-ratio, diagnostic-tests, medicine, predictive-value, r, r-package, sensitivity, specificity
- Language: R
- Homepage: https://chstock.github.io/DTComPair/
- Size: 4.04 MB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.Rmd
Awesome Lists containing this project
README
---
output: github_document
---```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#",
fig.path = "man/figures/README-",
out.width = "100%"
)
```[](https://lifecycle.r-lib.org/articles/stages.html#stable)
[](https://CRAN.R-project.org/package=DTComPair)
[](https://cran.r-project.org/package=DTComPair)
[](https://cran.r-project.org/package=DTComPair)Comparison of the accuracy of two binary diagnostic tests in a "paired" study design, i.e. when each test is applied to each subject in the study.
## Installation
**CRAN**
You can install the current stable version from CRAN with:
```{r cran-installation, eval = FALSE}
install.packages("DTComPair")
```**GitHub**
You can install the current development version from GitHub with:
```{r gh-installation, eval = FALSE}
if (!require("remotes")) {install.packages("remotes")}
remotes::install_github("chstock/DTComPair")
```## Scope
Diagnostic accuracy measures that can be computed and compared are sensitivity, specificity, positive and negative predictive values, and positive and negative diagnostic likelihood ratios.
## Getting Started
**Determine the accuracy of one diagnostic test**
```{r getting-started1}
library(DTComPair)
data(Paired1) # Hypothetical study data
a1 <- tab.1test(d=d, y=y1, data=Paired1)
print(a1)
a1 |> acc.1test(method.ci = "waldci") # default Wald intervals
a1 |> acc.1test(method.ci = "exactci") # Clopper-Pearson intervals
```**Compare the accuracy of two diagnostic tests**
***Compute accuracy measures***
```{r getting-started2}
b1 <- tab.paired(d = d, y1 = y1, y2 = y2, data = Paired1)
print(b1)
b1 |> acc.paired(method.ci = "scoreci") # Wilson intervals
```***Compare predictive values***
Test based on weighted generalized score statistic:
```{r getting-started3a}
pv.wgs(b1)
```Estimation and test of relative predictive values:
```{r getting-started3b}
pv.rpv(b1)
```