derive_vars_params {admiralvaccine}R Documentation

Assigning Parameter Variables

Description

Creating PARAMCD from lookup dataset and assigning PARAM,PARAMN,PARCAT1, PARCAT2 variables

Usage

derive_vars_params(dataset, lookup_dataset, merge_vars)

Arguments

dataset

Input dataset Input dataset is expected to have variables USUBJID,FAOBJ, FACAT, FATESTCD and FATEST

lookup_dataset

lookup dataset containing PARAMCD values for every unique FATESTCD and FAOBJ lookup dataset is expected to have variables FATEST, PARAMCD, FATESTCD, FAOBJ and one entry for every unique FATESTCD and FAOBJ

merge_vars

List of Variables need to be merged from lookup dataset

Details

A lookup dataset is required with PARAMCD values for every combination of FATEST & FAOBJ. PARAMCD PARAMN PARAMN PARCAT1 PARCAT2 values can be assigned from lookup dataset.

 if `PARAMN` not assigned in lookup dataset then
 `PARAMN` is assigned with a unique number for every unique PARAM value.
 if `PARAM` value not assigned in lookup dataset then
 `PARAM` value is a combination of `FAOBJ` `FATEST` `FASTRESU` `FALOC`
 `FADIR` `FALAT`
 if `PARCAT1` value not assigned in lookup dataset then
 `PARCAT1` is assigned as `FACAT`
 if `PARCAT2` value not assigned in lookup dataset then
 `PARCAT2` is assigned as `FASCAT`

Value

The output dataset contains all observations and variables of the input dataset along with PARAM,PARAMCD,PARCAT1,PARCAT2,PARAMN

Author(s)

Dhivya Kanagaraj

See Also

Other der_var: derive_var_aval_adis(), derive_vars_crit(), derive_vars_event_flag(), derive_vars_max_flag(), derive_vars_merged_vaccine(), derive_vars_vaxdt()

Examples


library(admiral)
library(tibble)
library(dplyr)

lookup_dataset <- tibble::tribble(
  ~FATESTCD, ~PARAMCD, ~PARAMN, ~FATEST, ~FAOBJ,
  "SEV", "SEVREDN", 1, "Severity", "Redness",
  "DIAMETER", "DIARE", 2, "Diameter", "Redness",
  "MAXDIAM", "MDIRE", 3, "Maximum Diameter cm", "Redness",
  "MAXTEMP", "MAXTEMP", 4, "Maximum Temperature", "Fever",
  "OCCUR", "OCFEVER", 5, "Occurrence Indicator", "Fever",
  "OCCUR", "OCERYTH", 6, "Occurrence Indicator", "Erythema",
  "SEV", "SEVPAIN", 7, "Severity", "Pain at Injection site",
  "OCCUR", "OCPAIN", 8, "Occurrence Indicator", "Pain at Injection site",
  "OCCUR", "OCSWEL", 9, "Occurrence Indicator", "Swelling"
)

input <- tibble::tribble(
  ~USUBJID, ~FACAT, ~FASCAT, ~FATESTCD, ~FAOBJ, ~FATEST, ~FALOC, ~FALAT,
  "ABC101", "REACTO", "ADMIN", "SEV", "Redness", "Severity", "ARM", "LEFT",
  "ABC101", "REACTO", "ADMIN", "DIAMETER", "Redness", "Diameter", "ARM", "RIGHT",
  "ABC101", "REACTO", "ADMIN", "MAXDIAM", "Redness", "Maximum Diameter", NA, NA,
  "ABC101", "REACTO", "SYSTEMIC", "MAXTEMP", "Fever", "Maximum Temp", NA, NA,
  "ABC101", "REACTO", "SYSTEMIC", "OCCUR", "Fever", "Occurrence", NA, NA,
  "ABC101", "REACTO", "ADMIN", "OCCUR", "Erythema", "Occurrence", NA, NA,
  "ABC101", "REACTO", "ADMIN", "SEV", "Swelling", "Severity", NA, NA,
  "ABC101", "REACTO", "ADMIN", "OCCUR", "Swelling", "Occurrence", NA, NA,
  "ABC101", "REACTO", "ADMIN", "OCCUR", "Swelling", "Occurrence", NA, NA
)

derive_vars_params(
  dataset = input,
  lookup_dataset = lookup_dataset,
  merge_vars = exprs(PARAMCD, PARAMN)
)


[Package admiralvaccine version 0.2.0 Index]