getAbnormalMark | R Documentation |
getAbnormalMark
generates a new column recorded abnormal values: high H
and L
.
getAbnormalMark(
labData,
idColName,
labItemColName,
valueColName,
genderColName,
genderTable,
referenceTable = refLOINC
)
labData |
a file or dataframe of laboratory test data with at least 4 columns about patient ID, lab item, test value and test date, respectively. |
idColName |
the column name that records patient ID in labData. |
labItemColName |
the column name that records lab item in labData. If lab code is combined by multiple columns, then just simply add |
valueColName |
the column name that records test value in labData. Only numeric value is acceptable. |
genderColName |
the column name that records gender of each patient. Gender should be coded as |
referenceTable |
a data table that records reference values of each lab item. Column names should be: |
This step is optional but recommended. Reference ranges differ in different institutions, so a user-defined reference table is needed. The table should record the reference values for male and female separately. Lower bound can be expressed as <
, (
(greater than) or <=
, [
(great tham or euqal to), and the expression of upper bound is similar. If there is no upper bound or lower bound, just remain empty. After the new abnormal flag column generated, it can be used to do categorical analysis, or be used in the function: plotTimeSeriesLab
.
A data.table
merged two tables.
loincSample <- mapLOINC(labData = labSample,
labItemColName = ITEMID,
mappingTable = mapSample)
#Use LONIC table (default)
getAbnormalMark(labData = loincSample,
idColName = SUBJECT_ID,
labItemColName = LOINC,
valueColName = VALUENUM,
genderColName = GENDER,
genderTable = patientSample,
referenceTable = refLOINC)
#Use user define table
getAbnormalMark(labData = labSample,
idColName = SUBJECT_ID,
labItemColName = ITEMID,
valueColName = VALUENUM,
genderColName = GENDER,
genderTable = patientSample,
referenceTable = refUserDefine)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.