Title: | ADaM in R Asset Library - Ophthalmology |
---|---|
Description: | Aids the programming of Clinical Data Standards Interchange Consortium (CDISC) compliant Ophthalmology Analysis Data Model (ADaM) datasets in R. ADaM datasets are a mandatory part of any New Drug or Biologics License Application submitted to the United States Food and Drug Administration (FDA). Analysis derivations are implemented in accordance with the "Analysis Data Model Implementation Guide" (CDISC Analysis Data Model Team, 2021, <https://www.cdisc.org/standards/foundational/adam/adamig-v1-3-release-package>). |
Authors: | Edoardo Mancini [aut, cre] , Ritika Aggarwal [aut], Jane Gao [aut], William Holmes [aut], Josie Jackson [aut], Sonali Jain [aut], Yuki Matsunaga [aut], Gordon Miller [aut], Rachel Linacre [aut], Lucy Palmen [aut], Nandini R Thampi [aut], Aldrich Salva [aut], Steven Ting [aut] |
Maintainer: | Edoardo Mancini <[email protected]> |
License: | Apache License (>= 2) |
Version: | 1.1.0.9008 |
Built: | 2024-11-19 14:23:28 UTC |
Source: | https://github.com/pharmaverse/admiralophtha |
An example Best Corrected Visual Acuity (BCVA) analysis dataset
admiralophtha_adbcva
admiralophtha_adbcva
An object of class tbl_df
(inherits from tbl
, data.frame
) with 7672 rows and 116 columns.
Derived from the OE and ADSL datasets using {admiral}
, {admiralophtha}
and
(https://github.com/pharmaverse/admiralophtha/blob/main/inst/templates/ad_adbcva.R)
Other datasets:
admiralophtha_adoe
,
admiralophtha_advfq
An example Ophthalmology Exam Analysis dataset
admiralophtha_adoe
admiralophtha_adoe
An object of class tbl_df
(inherits from tbl
, data.frame
) with 7672 rows and 98 columns.
Derived from the OE and ADSL datasets using {admiral}
, {admiralophtha}
and
(https://github.com/pharmaverse/admiralophtha/blob/main/inst/templates/ad_adoe.R)
Other datasets:
admiralophtha_adbcva
,
admiralophtha_advfq
An example Visual Function Questionnaire (VFQ) analysis dataset
admiralophtha_advfq
admiralophtha_advfq
An object of class tbl_df
(inherits from tbl
, data.frame
) with 28798 rows and 41 columns.
Derived from the ADSL and QS datasets using {admiral}
, {admiralophtha}
and
(https://github.com/pharmaverse/admiralophtha/blob/main/inst/templates/ad_advfq.R)
Other datasets:
admiralophtha_adbcva
,
admiralophtha_adoe
Convert ETDRS score to LogMAR units
convert_etdrs_to_logmar(value)
convert_etdrs_to_logmar(value)
value |
object containing ETDRS score to convert to logMAR |
ETDRS value converted to logMAR as logMAR = -0.02 * ETDRS + 1.7
Source for conversion formula: Beck, R.W., et al. A computerized method of visual acuity testing. American Journal of Ophthalmology, 135(2), pp.194-205. doi:https://doi.org/10.1016/s0002-9394(02)01825-1.
The input value converted converted to logMAR units
Rachel Linacre
library(tibble) library(dplyr) library(admiral) library(admiraldev) adbcva <- tribble( ~STUDYID, ~USUBJID, ~AVAL, "XXX001", "P01", 5, "XXX001", "P02", 10, "XXX001", "P03", 15, "XXX001", "P04", 20, "XXX001", "P05", 25 ) adbcva <- adbcva %>% mutate(AVAL = convert_etdrs_to_logmar(AVAL))
library(tibble) library(dplyr) library(admiral) library(admiraldev) adbcva <- tribble( ~STUDYID, ~USUBJID, ~AVAL, "XXX001", "P01", 5, "XXX001", "P02", 10, "XXX001", "P03", 15, "XXX001", "P04", 20, "XXX001", "P05", 25 ) adbcva <- adbcva %>% mutate(AVAL = convert_etdrs_to_logmar(AVAL))
Convert LogMAR score to ETDRS units
convert_logmar_to_etdrs(value)
convert_logmar_to_etdrs(value)
value |
object containing logMAR score to convert to ETDRS |
logMAR value converted to ETDRS as ETDRS = -(logMAR - 1.7) / 0.02
Source for conversion formula: Beck, R.W., et al. A computerized method of visual acuity testing. American Journal of Ophthalmology, 135(2), pp.194-205. doi:https://doi.org/10.1016/s0002-9394(02)01825-1.
The input value converted to ETDRS units
Nandini R Thampi
library(tibble) library(dplyr) library(admiral) oe <- tribble( ~STUDYID, ~USUBJID, ~OETESTCD, ~OEMETHOD, ~OESTRESN, "XXX001", "P01", "VACSCORE", "logMAR EYE CHART", 1.08, "XXX001", "P02", "VACSCORE", "logMAR EYE CHART", 1.66, "XXX001", "P03", "VACSCORE", "logMAR EYE CHART", 1.60, "XXX001", "P04", "VACSCORE", "ETDRS EYE CHART", 57, "XXX001", "P05", "VACSCORE", "ETDRS EYE CHART", 1 ) adbcva <- oe %>% filter(OETESTCD == "VACSCORE" & toupper(OEMETHOD) == "LOGMAR EYE CHART") %>% mutate(OESTRESN = convert_logmar_to_etdrs(OESTRESN))
library(tibble) library(dplyr) library(admiral) oe <- tribble( ~STUDYID, ~USUBJID, ~OETESTCD, ~OEMETHOD, ~OESTRESN, "XXX001", "P01", "VACSCORE", "logMAR EYE CHART", 1.08, "XXX001", "P02", "VACSCORE", "logMAR EYE CHART", 1.66, "XXX001", "P03", "VACSCORE", "logMAR EYE CHART", 1.60, "XXX001", "P04", "VACSCORE", "ETDRS EYE CHART", 57, "XXX001", "P05", "VACSCORE", "ETDRS EYE CHART", 1 ) adbcva <- oe %>% filter(OETESTCD == "VACSCORE" & toupper(OEMETHOD) == "LOGMAR EYE CHART") %>% mutate(OESTRESN = convert_logmar_to_etdrs(OESTRESN))
Derive Affected Eye (AFEYE
) in occurrence datasets
derive_var_afeye(dataset, loc_var, lat_var, loc_vals = "EYE")
derive_var_afeye(dataset, loc_var, lat_var, loc_vals = "EYE")
Affected Eye is derived in the occurrence dataset using laterality and Study Eye. This assumes Study Eye has already been added from ADSL.
The input occurrence dataset with Affected Eye (AFEYE
) added.
Lucy Palmen
library(tibble) library(admiral) adae1 <- tribble( ~STUDYID, ~USUBJID, ~STUDYEYE, ~AELOC, ~AELAT, "XXX001", "P01", "RIGHT", "EYE", "RIGHT", "XXX001", "P01", "RIGHT", "EYE", "LEFT", "XXX001", "P01", "RIGHT", "EYE", "", "XXX001", "P01", "RIGHT", "", "RIGHT", "XXX001", "P02", "LEFT", "", "", "XXX001", "P02", "LEFT", "EYE", "LEFT", "XXX001", "P04", "BILATERAL", "EYE", "RIGHT", "XXX001", "P05", "RIGHT", "EYE", "RIGHT", "XXX001", "P05", "RIGHT", "EYE", "BILATERAL", "XXX001", "P06", "BILATERAL", "", "", "XXX001", "P06", "BILATERAL", "", "RIGHT", "XXX001", "P07", "BILATERAL", "EYE", "BILATERAL", "XXX001", "P08", "", "EYE", "BILATERAL", "XXX001", "P09", "NONSENSE", "EYE", "BILATERAL", "XXX001", "P09", "BILATERAL", "EYE", "NONSENSE", "XXX001", "P09", "BILATERAL", "NONSENSE", "BILATERAL", "XXX001", "P10", "RIGHT", "EYE", "BOTH" ) derive_var_afeye(adae1, loc_var = AELOC, lat_var = AELAT) adae2 <- tribble( ~STUDYID, ~USUBJID, ~STUDYEYE, ~AELOC, ~AELAT, "XXX001", "P01", "RIGHT", "EYES", "RIGHT", "XXX001", "P02", "RIGHT", "RETINA", "LEFT", "XXX001", "P03", "LEFT", "", "" ) derive_var_afeye(adae2, loc_var = AELOC, lat_var = AELAT, loc_vals = c("EYES", "RETINA"))
library(tibble) library(admiral) adae1 <- tribble( ~STUDYID, ~USUBJID, ~STUDYEYE, ~AELOC, ~AELAT, "XXX001", "P01", "RIGHT", "EYE", "RIGHT", "XXX001", "P01", "RIGHT", "EYE", "LEFT", "XXX001", "P01", "RIGHT", "EYE", "", "XXX001", "P01", "RIGHT", "", "RIGHT", "XXX001", "P02", "LEFT", "", "", "XXX001", "P02", "LEFT", "EYE", "LEFT", "XXX001", "P04", "BILATERAL", "EYE", "RIGHT", "XXX001", "P05", "RIGHT", "EYE", "RIGHT", "XXX001", "P05", "RIGHT", "EYE", "BILATERAL", "XXX001", "P06", "BILATERAL", "", "", "XXX001", "P06", "BILATERAL", "", "RIGHT", "XXX001", "P07", "BILATERAL", "EYE", "BILATERAL", "XXX001", "P08", "", "EYE", "BILATERAL", "XXX001", "P09", "NONSENSE", "EYE", "BILATERAL", "XXX001", "P09", "BILATERAL", "EYE", "NONSENSE", "XXX001", "P09", "BILATERAL", "NONSENSE", "BILATERAL", "XXX001", "P10", "RIGHT", "EYE", "BOTH" ) derive_var_afeye(adae1, loc_var = AELOC, lat_var = AELAT) adae2 <- tribble( ~STUDYID, ~USUBJID, ~STUDYEYE, ~AELOC, ~AELAT, "XXX001", "P01", "RIGHT", "EYES", "RIGHT", "XXX001", "P02", "RIGHT", "RETINA", "LEFT", "XXX001", "P03", "LEFT", "", "" ) derive_var_afeye(adae2, loc_var = AELOC, lat_var = AELAT, loc_vals = c("EYES", "RETINA"))
CRITx
/CRITxFL
pairs to BCVA datasetAdds a criterion variables CRITx
and their corresponding flags CRITxFL
to a
dataset containing BCVA records
derive_var_bcvacritxfl( dataset, crit_var, bcva_ranges = NULL, bcva_uplims = NULL, bcva_lowlims = NULL, additional_text = "", critxfl_index = NULL )
derive_var_bcvacritxfl( dataset, crit_var, bcva_ranges = NULL, bcva_uplims = NULL, bcva_lowlims = NULL, additional_text = "", critxfl_index = NULL )
dataset |
Input dataset containing BCVA data (usually ADBCVA). |
crit_var |
Variable with respect to which |
bcva_ranges |
List containing one or more numeric vectors of length 2. For each
vector |
bcva_uplims |
List containing one or more numeric elements. For each
element a in |
bcva_lowlims |
List containing one or more numeric elements. For each
element b in |
additional_text |
string containing additional text to append to |
critxfl_index |
positive integer detailing the first value of x to use
in |
This function works by calling derive_var_bcvacritxfl()
once for each of the
elements in bcva_ranges
, bcva_uplims
and bcva_lowlims
.
NOTE: if crit_var
is equal to NA
, then the resulting criterion flag is also marked
as NA
.
The input BCVA dataset with additional column pairsCRITx
, CRITxFL
.
Edoardo Mancini
library(tibble) library(admiral) library(admiraldev) adbcva1 <- tribble( ~STUDYID, ~USUBJID, ~AVISIT, ~BASETYPE, ~PARAMCD, ~CHG, "XXX001", "P01", "BASELINE", "LAST", "SBCVA", 0, "XXX001", "P01", "WEEK 2", "LAST", "FBCVA", 2, "XXX001", "P02", "BASELINE", "LAST", "SBCVA", -13, "XXX001", "P02", "WEEK 2", "LAST", "FBCVA", 5, "XXX001", "P03", "BASELINE", "LAST", "SBCVA", NA, "XXX001", "P03", "WEEK 2", "LAST", "FBCVA", 17 ) derive_var_bcvacritxfl( dataset = adbcva1, crit_var = exprs(CHG), bcva_ranges = list(c(0, 5), c(-5, -1), c(10, 15)), bcva_uplims = list(5, 10), bcva_lowlims = list(8), additional_text = "" ) adbcva2 <- tribble( ~STUDYID, ~USUBJID, ~AVISIT, ~BASETYPE, ~PARAMCD, ~AVAL, ~CHG, "XXX001", "P01", "BASELINE", "LAST", "SBCVA", 4, NA, "XXX001", "P01", "BASELINE", "LAST", "SBCVA", 6, NA, "XXX001", "P01", "AVERAGE BASELINE", "AVERAGE", "SBCVA", 5, NA, "XXX001", "P01", "WEEK 2", "LAST", "SBCVA", -3, NA, "XXX001", "P01", "WEEK 4", "LAST", "SBCVA", -10, NA, "XXX001", "P01", "WEEK 6", "LAST", "SBCVA", 12, NA, "XXX001", "P01", "WEEK 2", "AVERAGE", "SBCVA", -2, -7, "XXX001", "P01", "WEEK 4", "AVERAGE", "SBCVA", 6, 1, "XXX001", "P01", "WEEK 6", "AVERAGE", "SBCVA", 3, -2 ) restrict_derivation( adbcva2, derivation = derive_var_bcvacritxfl, args = params( crit_var = exprs(CHG), bcva_ranges = list(c(0, 5), c(-10, 0)), bcva_lowlims = list(5), additional_text = " (AVERAGE)" ), filter = PARAMCD %in% c("SBCVA", "FBCVA") & BASETYPE == "AVERAGE" )
library(tibble) library(admiral) library(admiraldev) adbcva1 <- tribble( ~STUDYID, ~USUBJID, ~AVISIT, ~BASETYPE, ~PARAMCD, ~CHG, "XXX001", "P01", "BASELINE", "LAST", "SBCVA", 0, "XXX001", "P01", "WEEK 2", "LAST", "FBCVA", 2, "XXX001", "P02", "BASELINE", "LAST", "SBCVA", -13, "XXX001", "P02", "WEEK 2", "LAST", "FBCVA", 5, "XXX001", "P03", "BASELINE", "LAST", "SBCVA", NA, "XXX001", "P03", "WEEK 2", "LAST", "FBCVA", 17 ) derive_var_bcvacritxfl( dataset = adbcva1, crit_var = exprs(CHG), bcva_ranges = list(c(0, 5), c(-5, -1), c(10, 15)), bcva_uplims = list(5, 10), bcva_lowlims = list(8), additional_text = "" ) adbcva2 <- tribble( ~STUDYID, ~USUBJID, ~AVISIT, ~BASETYPE, ~PARAMCD, ~AVAL, ~CHG, "XXX001", "P01", "BASELINE", "LAST", "SBCVA", 4, NA, "XXX001", "P01", "BASELINE", "LAST", "SBCVA", 6, NA, "XXX001", "P01", "AVERAGE BASELINE", "AVERAGE", "SBCVA", 5, NA, "XXX001", "P01", "WEEK 2", "LAST", "SBCVA", -3, NA, "XXX001", "P01", "WEEK 4", "LAST", "SBCVA", -10, NA, "XXX001", "P01", "WEEK 6", "LAST", "SBCVA", 12, NA, "XXX001", "P01", "WEEK 2", "AVERAGE", "SBCVA", -2, -7, "XXX001", "P01", "WEEK 4", "AVERAGE", "SBCVA", 6, 1, "XXX001", "P01", "WEEK 6", "AVERAGE", "SBCVA", 3, -2 ) restrict_derivation( adbcva2, derivation = derive_var_bcvacritxfl, args = params( crit_var = exprs(CHG), bcva_ranges = list(c(0, 5), c(-10, 0)), bcva_lowlims = list(5), additional_text = " (AVERAGE)" ), filter = PARAMCD %in% c("SBCVA", "FBCVA") & BASETYPE == "AVERAGE" )
Derive Study Eye (STUDYEYE
) in the ADSL dataset
derive_var_studyeye(dataset_adsl, dataset_sc, sctestcd_value = "FOCID")
derive_var_studyeye(dataset_adsl, dataset_sc, sctestcd_value = "FOCID")
dataset_adsl |
ADSL input dataset |
dataset_sc |
SC input dataset |
sctestcd_value |
|
Study Eye is derived in ADSL using the "Study Eye selection" records in the SC SDTM dataset.
The input ADSL dataset with an additional column named STUDYEYE
Edoardo Mancini
library(tibble) library(admiral) adsl <- tribble( ~STUDYID, ~USUBJID, "XXX001", "P01", "XXX001", "P02", "XXX001", "P03", "XXX001", "P04", "XXX001", "P05" ) sc <- tribble( ~STUDYID, ~USUBJID, ~SCTESTCD, ~SCSTRESC, "XXX001", "P01", "FOCID", "OS", "XXX001", "P01", "ACOHORT", "COHORT1", "XXX001", "P02", "FOCID", "OD", "XXX001", "P02", "ACOHORT", "COHORT3", "XXX001", "P04", "FOCID", "OU", "XXX001", "P05", "FOCID", "OD", "XXX001", "P06", "FOCID", "OS" ) derive_var_studyeye(adsl, sc)
library(tibble) library(admiral) adsl <- tribble( ~STUDYID, ~USUBJID, "XXX001", "P01", "XXX001", "P02", "XXX001", "P03", "XXX001", "P04", "XXX001", "P05" ) sc <- tribble( ~STUDYID, ~USUBJID, ~SCTESTCD, ~SCSTRESC, "XXX001", "P01", "FOCID", "OS", "XXX001", "P01", "ACOHORT", "COHORT1", "XXX001", "P02", "FOCID", "OD", "XXX001", "P02", "ACOHORT", "COHORT3", "XXX001", "P04", "FOCID", "OU", "XXX001", "P05", "FOCID", "OD", "XXX001", "P06", "FOCID", "OS" ) derive_var_studyeye(adsl, sc)