View source: R/getControlSubj.R
getControlSubj | R Documentation |
Returns a data table with a list of animals belonging to the groups for
negative control in the given list of studies.
getControlSubj(dbToken, studyList, inclUncertain = FALSE)
dbToken |
Mandatory. |
studyList |
Mandatory, data.table. |
inclUncertain |
Mandatory, boolean. |
The set of animals contains all animals from DM where the SETCD is associated with a TX parameter 'TCNTRL'. Negative control animals are further defined by
either containing a word from a set of words, to automatically distinguish it as a negative control:
['placebo', 'untreated', 'sham']
or containing a combination of a word from of two lists:
['negative', 'saline', 'peg', 'vehicle', 'citrate', 'dextrose', 'water', 'air']
['item', 'control', 'article']
Animals are in all cases excluded (i.e. whether inclUncertain=TRUE
or
inclUncertain=FALSE
) from the output set, when they are identified as
positive control animals - i.e. they are associated with a TX parameter
'TCNTRL' containing a word from this set of words:
['positive','reference']
The age in days at reference start date is calculated for each animal based on the age related variables in DM:
If BRTHDTC is populated compute DM.RFSTDTC – DM.BRTHDTC + 1
Else If AGE is populated convert from units specified in AGEU to days.
Else If AGETXT is populated convert the mid-point of the range from
units specified in AGEU to days.
These AGEU units are handled with the described conversion from value to
number of days:
DAYS
WEEKS : value * 7
MONTHS : value * 365/12
YEARS : value * 365
If input parameter inclUncertain=TRUE
, uncertain animals are included
in the output set. These uncertain situations are identified and reported (in
column UNCERTAIN_MSG):
TX parameter 'TCNTRL' is missing
TXVAL for TX parameter 'TCNTRL' cannot be identified as Negative or Positive control according to the algorithm described above
The function return a data.table with columns:
STUDYID (character)
Additional columns contained in the studyList
table
TCNTRL (character)
The value of the TX parameter TCNTRL which is used for identification
of whether it is a negative control group or not
USUBJID (character)
RFSTDTC (character)
DM_AGEDAYS (integer)
The calculated age in days of the animal at the reference start day
- i.e. the age registered in DM.
DSDECOD (character)
The standardized disposition term for the animal
DS_AGEDAYS (integer)
The calculated age in days of the animal at the disposition
NO_AGE_MSG (character)
Empty or contains the reason if a DM_AGEDAYS couldn't be calculated
UNCERTAIN_MSG (character)
Included when parameter inclUncertain=TRUE
.
Contains the reason for an uncertain animal is NA for rows for
confident identified negative control animals.
NOT_VALID_MSG (character)
Included if the column is included in data table specified in
studyList
,
## Not run: controlAnimals <- getControlSubj(myDbToken, allSTudies) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.