Get Laboratory Test Results (LB) domain Z-score for a given STUDYID from SQLite Database or .xpt
Files
Source: R/get_lb_score.R
get_lb_score.Rd
This function computes the LB Z-score for a given STUDYID using data stored in a specified database.
It offers various optional parameters to customize the output, such as whether to return individual scores or Z-scores by USUBJID
.
Usage
get_lb_score(
studyid = NULL,
path_db,
fake_study = FALSE,
use_xpt_file = FALSE,
master_compiledata = NULL,
return_individual_scores = FALSE,
return_zscore_by_USUBJID = FALSE
)
Arguments
- studyid
Character. STUDYID number. Defaults to
NULL
. Required for SQLite databases (use_xpt_file = FALSE
). Must beNULL
for.xpt
files (use_xpt_file = TRUE
).- path_db
Character. Path to the SQLite database file or a folder containing
.xpt
files. Mandatory.- fake_study
Logical. Whether the study data is generated by the
SENDsanitizer
package. Defaults toFALSE
.- use_xpt_file
Logical. Whether to retrieve study data from
.xpt
files instead of the SQLite database. Defaults toFALSE
.- master_compiledata
Optional, character
Ifmaster_compiledata
is not supplied (i.e.,NULL
), the function will automatically call theget_compile_data
function to calculate it.- return_individual_scores
Optional, logical
If TRUE, the function returns individual scores for each domain by averaging the scores of all subjects/animals (USUBJID
) in the study. Default isFALSE
.- return_zscore_by_USUBJID
Optional, logical
IfTRUE
, the function returns Z-scores for each animal/subject byUSUBJID
. Default isFALSE
.
Value
A data frame containing the LB Z-scores:
If
return_individual_scores = TRUE
: Returns averaged Z-scores for each domain perstudyid
.If
return_zscore_by_USUBJID = TRUE
: Returns Z-score for each animal/subject byUSUBJID
for each domain perstudyid
.Otherwise, a summarized BW score for the specified
studyid
.