-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
74 lines (56 loc) · 3.34 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
---
output: github_document
editor_options:
markdown:
wrap: 72
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE, warn = FALSE, message = FALSE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# PhenotypeR <img src="man/figures/logo.png" align="right" height="180"/>
<!-- badges: start -->
[![R-CMD-check](https://github.com/ohdsi/PhenotypeR/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/ohdsi/PhenotypeR/actions/workflows/R-CMD-check.yaml)
[![Lifecycle:Experimental](https://img.shields.io/badge/Lifecycle-Experimental-339999)](https://lifecycle.r-lib.org/articles/stages.html#experimental)
<!-- badges: end -->
The PhenotypeR package helps us to assess the research-readiness of a set of cohorts we have defined. This assessment includes:
- ___Database diagnostics___ which help us to better understand the database in which they have been created. This includes information about the size of the data, the time period covered, the number of people in the data as a whole. More granular information that may influence analytic decisions, such as the number of observation periods per person, is also described.
- ___Codelist diagnostics___ which help to answer questions like what concepts from our codelist are used in the database? What concepts were present led to individuals' entry in the cohort? Are there any concepts being used in the database that we didn't include in our codelist but maybe we should have?
- ___Cohort diagnostics___ which help to answer questions like how many individuals did we include in our cohort and how many were excluded because of our inclusion criteria? If we have multiple cohorts, is there overlap between them and when do people enter one cohort relative to another? What is the incidence of cohort entry and what is the prevalence of the cohort in the database?
- ___Matched diagnostics___ which compares our study cohorts to the overall population in the database. By matching people in the cohorts to people with a similar age and sex in the database we can see how our cohorts differ from the general database population.
- ___Population diagnostics___ which estimates the frequency of our study cohorts in the database in terms of their incidence rates and prevalence.
## Installation
You can install PhenotypeR from GitHub:
```{r, eval = FALSE}
# install.packages("remotes")
remotes::install_github("ohdsi/PhenotypeR")
```
## Example usage
```{r, message=FALSE, warning=FALSE}
library(omopgenerics)
library(CDMConnector)
library(PhenotypeR)
library(CohortConstructor)
library(dplyr)
con <- DBI::dbConnect(duckdb::duckdb(dbdir = CDMConnector::eunomia_dir()))
cdm <- CDMConnector::cdm_from_con(con = con,
cdm_schema = "main",
write_schema = "main")
cdm$gibleed <- conceptCohort(cdm = cdm,
conceptSet = list(gibleed = 192671L),
name = "gibleed")
result <- cdm$gibleed |>
phenotypeDiagnostics()
```
```{r, message = TRUE}
summary(result)
```
Once we have our results we can quickly view them in an interactive application. This shiny app will be saved in a new directory and can be further customised.
```{r, eval=FALSE}
shinyDiagnostics(result = result, directory = tempdir())
```