Get Microscopic Findings (MI) domain Z-score for a given STUDYID from SQLite Database or .xpt Files
Source: R/get_mi_score.R
get_mi_score.RdThis function calculates the MI score for a given STUDYID using data stored in a specified database.
Usage
get_mi_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 beNULLfor.xptfiles (use_xpt_file = TRUE).- path_db
Character. Path to the SQLite database file or a folder containing
.xptfiles. Mandatory.- fake_study
Logical. Whether the study data is generated by the
SENDsanitizerpackage. Defaults toFALSE.- use_xpt_file
Logical. Whether to retrieve study data from
.xptfiles instead of the SQLite database. Defaults toFALSE.- master_compiledata
Optional, character
Ifmaster_compiledatais not supplied (i.e.,NULL), the function will automatically call theget_compile_datafunction 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 MI 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 byUSUBJIDfor each domain perstudyid.Otherwise, a summarized BW score for the specified
studyid.