Learn R Programming

sdtmchecks (version 1.0.0)

check_lb_lbstnrlo_lbstnrhi: Check for missing lab reference ranges (LBSTNRLO, LBSTNRHI)

Description

This check looks for missing lab reference ranges (LBSTNRLO, LBSTNRHI) in standard units when numeric result in standard unit (LBSTRESN) is not missing and returns a data frame

Usage

check_lb_lbstnrlo_lbstnrhi(DM, LB)

Value

boolean value if check failed or passed with 'msg' attribute if the test failed

Arguments

DM

DM SDTM dataset with variable USUBJID, SITEID

LB

Lab SDTM dataset with variables USUBJID, LBTEST, LBSTRESN, LBSTNRLO, LBSTNRHI

Author

Lei Zhao

Examples

Run this code

LB <- data.frame(
USUBJID = "1",
LBTEST = "Albumin",
LBSTRESN = 1:10,
LBSTNRLO = 1:10,
LBSTNRHI = 1:10,
stringsAsFactors=FALSE
)

LB$LBSTNRLO[1]=""
LB$LBSTNRLO[2]="NA"
LB$LBSTNRLO[3]=NA
LB$LBSTNRHI[3]=""
LB$LBSTNRHI[4]="NA"
LB$LBSTNRHI[5]=NA

DM <- data.frame(
USUBJID = "1",
SITEID = "123456",
stringsAsFactors=FALSE
)

check_lb_lbstnrlo_lbstnrhi(DM, LB)

Run the code above in your browser using DataLab