Skip to content

Commit

Permalink
function and variable names are in backquotes
Browse files Browse the repository at this point in the history
  • Loading branch information
sonalijain17 committed Sep 3, 2023
1 parent f1f9392 commit 44b1f1d
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 31 deletions.
34 changes: 18 additions & 16 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,25 @@

- Added a new parameter `crit_var` to `derive_var_bcvacritxfl()` so that criterion flags can be derived with respect to any variable. Also removed arguments `paramcds` and `basetype` as their function can be achieved using `restrict_derivation()` from `{admiral}`. This also required renaming of argument `dataset_adbcva` to `dataset` (#119).

- Added `AFEYE` derivation and description to `ADOE` Vignette (#165).
- Added `AFEYE` derivation and description to ADOE Vignette (#165).

## Updates to Templates

- Updated `ADBCVA` template's calls to use `restrict_derivation()` in calls to `derive_var_bcvacritxfl()` and also to showcase use of `crit_var` argument of `derive_var_bcvacritxfl()` (#119).
- Updated ADBCVA template's calls to use `restrict_derivation()` in calls to `derive_var_bcvacritxfl()` and also to showcase use of `crit_var` argument of `derive_var_bcvacritxfl()` (#119).

- Switched out all references to `admiral.test` for references to `pharmaversesdtm` in `ADOE` and `ADBCVA` templates, and updated code to refer to `oe_ophtha` accordingly (#184).
- Switched out all references to `admiral.test` for references to `pharmaversesdtm` in ADOE and ADBCVA templates, and updated code to refer to `oe_ophtha` accordingly (#184).

- Switched out `derive_var_merged_cat()` for `derive_vars_merged()` in the function `derive_var_Studyeye()` due to deprecation of the former in favor of the latter in `{admiral }`(#119).
- Switched out `derive_var_merged_cat()` for `derive_vars_merged()` in the function `derive_var_Studyeye()` due to deprecation of the former in favor of the latter in `{admiral}`(#119).

- `OECAT` and `OESCAT` have been added to the lookup tables in the `ADOE` and `ADBCVA` templates (#189).
- `OECAT` and `OESCAT` have been added to the lookup tables in the ADOE and ADBCVA templates (#189).

## Updates to Documentation

- Added a reference for the ETDRS to LogMAR conversion done by `convert_etdrs_to_logmar()` and `convert_logmar_to_etdrs()` (#136).

- `OECAT` and `OESCAT` have been added to the lookup tables in the `ADOE` and `ADBCVA` vignettes (#189).
- `OECAT` and `OESCAT` have been added to the lookup tables in the ADOE and ADBCVA vignettes (#189).

- All function and variable names on the website are in backquotes (#173).

## Updates to Data

Expand All @@ -37,11 +39,11 @@

## Updates to Templates

- Updated `ADOE` to refer to `OESTRESU` for `AVALU` creation (issue #139).
- Updated `ADOE` and `ADBCVA` `PARAM` mapping to include units where applicable (issue #139).
- Updated `ADOE`, `ADVFQ` and `ADBCVA` for the unique intermediate dataset name to avoid overwriting, corrected the link for Visit and Period variables Vignette in `ADVFQ` (issue #128).
- Corrected values of `DTYPE`, `VISIT`, `VISITNUM`, `OEDY`, `OEDTC` for derived parameters in `ADBCVA` template (issue #137).
- Updated `ADBCVA` and `ADOE` templates to include `AFEYE` (issue #133).
- Updated ADOE to refer to `OESTRESU` for `AVALU` creation (issue #139).
- Updated ADOE and ADBCVA `PARAM` mapping to include units where applicable (issue #139).
- Updated ADOE, ADVFQ and ADBCVA for the unique intermediate dataset name to avoid overwriting, corrected the link for Visit and Period variables Vignette in ADVFQ (issue #128).
- Corrected values of `DTYPE`, `VISIT`, `VISITNUM`, `OEDY`, `OEDTC` for derived parameters in ADBCVA template (issue #137).
- Updated ADBCVA and ADOE templates to include `AFEYE` (issue #133).

## Updates to Site

Expand All @@ -52,11 +54,11 @@

## New Features

- Added a function to derive the variable `STUDYEYE` in `ADSL` (issue #9).
- Added a function to derive the variable `STUDYEYE` in ADSL (issue #9).
- Added a function to derive the variable `AFEYE` in Occurrence datasets (issue #10).
- Added a function to derive the criterion flags in `ADBCVA` (issue #49).
- Added a function to derive the criterion flags in ADBCVA (issue #49).
- Added a function to convert LogMAR scores to ETDRS scores (issue #50).
- Added a function to convert ETDRS scores to LogMAR scores (issue #50).
- Created ophthalmology-specific test data for the `EX` SDTM domain, stored in `{admiralophtha}` package and accessible by calling `data(admiralophtha_ex)` (issue #36).
- Created ophthalmology-specific test data for the `SC` and `OE` SDTM domains, stored in `{admiral}` package and accessible by calling `data(admiral_sc)` or `data(admiral_oe)` (issues #11 and #13).
- Updated `AE` and `QS` test datasets in `{admiral}` to include ophthalmology-specific variables and records, such as laterality variables in `AE` and VFQ records in `QS` (issues #12 and #52).
- Created ophthalmology-specific test data for the EX SDTM domain, stored in `{admiralophtha}` package and accessible by calling `data(admiralophtha_ex)` (issue #36).
- Created ophthalmology-specific test data for the SC and OE SDTM domains, stored in `{admiral}` package and accessible by calling `data(admiral_sc)` or `data(admiral_oe)` (issues #11 and #13).
- Updated AE and QS test datasets in `{admiral}` to include ophthalmology-specific variables and records, such as laterality variables in AE and VFQ records in QS (issues #12 and #52).
2 changes: 1 addition & 1 deletion vignettes/adbcva.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ Some ophthalmology studies may desire to subdivide BCVA records according to whi
* Create a lookup table which assigns numeric equivalents (i.e. `AVALCAxN`) to Snellen categories.
* Create a format function to map each `AVAL` to a numeric category.
* Add `AVALCAxN` through a mutate statement using the format function.
* Add `AVALCATx` using derive_vars_merged in combination with the lookup table.
* Add `AVALCATx` using `derive_vars_merged` in combination with the lookup table.

```{r}
avalcat_lookup <- tibble::tribble(
Expand Down
6 changes: 3 additions & 3 deletions vignettes/advfq.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ admiral_homepage <- "https://pharmaverse.github.io/admiral"

# Introduction

This article describes creating an `ADVFQ` ADaM with Visual Functioning Questionnaire
This article describes creating an ADVFQ ADaM with Visual Functioning Questionnaire
data for ophthalmology endpoints. It is to be used in conjunction with the article on [creating a BDS dataset from SDTM](https://pharmaverse.github.io/admiral/cran-release/articles/bds_finding.html). As such, derivations and processes that are not specific to ADVFQ are absent, and the user is invited to consult the aforementioned article for guidance.

**Note**: *All examples assume CDISC SDTM and/or ADaM format as input unless
Expand Down Expand Up @@ -89,7 +89,7 @@ qs <- qs_ophtha
qs <- qs %>% filter(QSTESTCD %in% c("VFQ1", "VFQ2", "VFQ3", "VFQ4"))
```
Next, the programmer should create a parameter lookup table which includes `QSTESTCD`, `PARAMCD`, `PARAM`, `PARCAT1` and `PARCAT2` variables. This should include all parameters that will be needed in the final `ADVFQ` and will be used later to merge parameter information.
Next, the programmer should create a parameter lookup table which includes `QSTESTCD`, `PARAMCD`, `PARAM`, `PARCAT1` and `PARCAT2` variables. This should include all parameters that will be needed in the final ADVFQ and will be used later to merge parameter information.

```{r, eval=FALSE}
param_lookup <- tibble::tribble(
Expand Down Expand Up @@ -193,7 +193,7 @@ In most finding ADaMs, an analysis flag is derived to identify the appropriate o

In this situation, an analysis flag (e.g. `ANLxxFL`) may be used to choose the appropriate record for analysis.

This flag may be derived using the [`admiral`](https://pharmaverse.github.io/admiral/) function `admiral::derive_var_extreme_flag()`. For this example, we will assume we would like to choose the latest value by USUBJID, PARAMCD and AVISIT.
This flag may be derived using the [`admiral`](https://pharmaverse.github.io/admiral/) function `admiral::derive_var_extreme_flag()`. For this example, we will assume we would like to choose the latest value by `USUBJID`, `PARAMCD` and `AVISIT`.

```{r, eval=FALSE}
## ANL01FL: Flag last result within an AVISIT for post-baseline records ----
Expand Down
22 changes: 11 additions & 11 deletions vignettes/standards.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ Applying the standards below is by no means mandatory, but will help in leveragi

## Dataset Subdivision

Due to the aforementioned high complexity and diversity of ophthalmology data, it is discouraged to funnel *all* records from the `OE` SDTM dataset into a single `ADOE` dataset, as this will result in an overly complicated program/dataset pair. `{admiralophtha}` instead suggests the following partition:
Due to the aforementioned high complexity and diversity of ophthalmology data, it is discouraged to funnel *all* records from the OE SDTM dataset into a single ADOE dataset, as this will result in an overly complicated program/dataset pair. `{admiralophtha}` instead suggests the following partition:

* `ADOE` for general miscellaneous ophthalmology tests not used for efficacy programming.
* `ADBCVA` for BCVA data only - these will almost always constitute a primary or secondary endpoint and so will require endpoint-related programming such as criterion flags.
* Any other endpoints for which specific efficacy programming may be required should have their own ADaM dataset (e.g. for intraocular pressure data, `ADIOP`).
* `ADVFQ` for Visual Functioning Questionnaire data.
* ADOE for general miscellaneous ophthalmology tests not used for efficacy programming.
* ADBCVA for BCVA data only - these will almost always constitute a primary or secondary endpoint and so will require endpoint-related programming such as criterion flags.
* Any other endpoints for which specific efficacy programming may be required should have their own ADaM dataset (e.g. for intraocular pressure data, ADIOP).
* ADVFQ for Visual Functioning Questionnaire data.

Subdividing the ADaM datasets in a study as above will ensure that wherever custom efficacy programming is required, this will automatically be limited to the data of interest. For instance, if a study has various endpoints of the form *Gain of between x and y letters relative to baseline* (or similar) then each will likely require a criterion variable/flag pair (see the [Criterion Flag](#criterion) section for more detail). If the BCVA data were stored in `ADOE`, then these criterion variable/flag pairs would be blank and irrelevant for most of the data in the dataset, save for the BCVA records. Conversely, collecting the BCVA data in `ADBCVA` ensures the criterion variable/flag pairs are more relevant, and the resulting dataset is more readable.
Subdividing the ADaM datasets in a study as above will ensure that wherever custom efficacy programming is required, this will automatically be limited to the data of interest. For instance, if a study has various endpoints of the form *Gain of between x and y letters relative to baseline* (or similar) then each will likely require a criterion variable/flag pair (see the [Criterion Flag](#criterion) section for more detail). If the BCVA data were stored in ADOE, then these criterion variable/flag pairs would be blank and irrelevant for most of the data in the dataset, save for the BCVA records. Conversely, collecting the BCVA data in ADBCVA ensures the criterion variable/flag pairs are more relevant, and the resulting dataset is more readable.

## Criterion Flags {#criterion}
`{admiralophtha}` suggests the use of criterion variable/flag pairs `CRITx/CRITxFL` where possible for endpoint programming. If implemented correctly, this is a very transparent approach as the condition for `CRITxFL` can be clearly encoded in `CRITx`, without having to view any documentation. When appropriate, the condition in `CRITx` should be represented programmatically rather than in words to reduce possibility of confusion. For instance, for an endpoint such as *Gain of between x and y letters relative to baseline*, one would set `CRIT1 = "x <= CHG <= y"`.
Expand All @@ -71,10 +71,10 @@ For BCVA change endpoints, provides the function `derive_var_bcvacritxfl` to add

## Affected Eye Derivation
`{admiralophtha}` function `derive_var_afeye` follows the standard derivation:
Set to "BOTH EYES" when Study Eye Selection [ADSL.STUDYEYE] is not missing, and Laterality [xxLAT] is equal to "BILATERAL".
Else set to "STUDY EYE" when Study Eye Selection [ADSL.STUDYEYE] is either "RIGHT" or "LEFT", and matches Laterality [xxLAT] for the observation record.
Else set to "STUDY EYE" when Study Eye Selection [ADSL.STUDYEYE] is "BILATERAL", and Laterality [xxLAT] is not missing for the observation record.
Else set to "FELLOW EYE" when Study Eye Selection [ADSL.STUDYEYE] is either "RIGHT" or "LEFT", and [xxLAT] is not missing and does not match Laterality [xxLAT] for the observation record.
Set to "BOTH EYES" when Study Eye Selection [`ADSL.STUDYEYE`] is not missing, and Laterality [`xxLAT`] is equal to "BILATERAL".
Else set to "STUDY EYE" when Study Eye Selection [`ADSL.STUDYEYE`] is either "RIGHT" or "LEFT", and matches Laterality [`xxLAT`] for the observation record.
Else set to "STUDY EYE" when Study Eye Selection [`ADSL.STUDYEYE`] is "BILATERAL", and Laterality [`xxLAT`] is not missing for the observation record.
Else set to "FELLOW EYE" when Study Eye Selection [`ADSL.STUDYEYE`] is either "RIGHT" or "LEFT", and [`xxLAT`] is not missing and does not match Laterality [`xxLAT`] for the observation record.
Else set to null.

If the standard values of Location [xxLOC] = "EYE" and Laterality [xxLAT] = "LEFT", "RIGHT", "BILATERAL" are not the same for your study this can be updated as inputs in the function, otherwise this is also expected for `AFEYE` to be derived, and a warning will be returned if any other values are found.
If the standard values of Location [`xxLOC`] = "EYE" and Laterality [`xxLAT`] = "LEFT", "RIGHT", "BILATERAL" are not the same for your study this can be updated as inputs in the function, otherwise this is also expected for `AFEYE` to be derived, and a warning will be returned if any other values are found.

0 comments on commit 44b1f1d

Please sign in to comment.