confirmVars {csmpv} | R Documentation |
Biomarker Confirmation Function
Description
This function confirms and validates known biomarkers in a given dataset.
Usage
confirmVars(
data = NULL,
standardization = FALSE,
columnWise = TRUE,
biomks = NULL,
outcomeType = c("binary", "continuous", "time-to-event"),
Y = NULL,
time = NULL,
event = NULL,
outfile = "nameWithPath"
)
Arguments
data |
A data matrix or data frame with samples in rows and features/traits (including outcome and biomarkers) in columns. |
standardization |
Logical; indicates if standardization is needed before biomarker confirmation/validation. Default is FALSE. |
columnWise |
Logical; indicates if column-wise or row-wise normalization is needed for standardization. Default is TRUE. |
biomks |
A vector of biomarker names to confirm/validate. Subset of column names in the data parameter. |
outcomeType |
The type of the outcome variable. It has three choices: "binary" (default), "continuous", and "time-to-event". |
Y |
The outcome variable name when the outcome type is either "binary" or "continuous". |
time |
The time variable name when the outcome type is "time-to-event". |
event |
The event variable name when the outcome type is "time-to-event". |
outfile |
A string representing the output file, including the path if necessary, but without the file type extension |
Details
Use this function to assess whether individual variables or groups of variables have an impact on an outcome variable within a dataset. The outcome variable can be binary, continuous, or time-to-event. Note that this function is not intended for model confirmation, as it doesn't incorporate coefficients from previous research.
Value
A list containing:
fit |
A model with selected variables for the given outcome variable. |
allplot |
A list of plots generated during the confirmation/validation process. |
There might be extra plots in the list for time-to-event outcome
Author(s)
Aixiang Jiang
References
Hastie, T. J. and Pregibon, D. (1992) Generalized linear models. Chapter 6 of Statistical Models in S eds J. M. Chambers and T. J. Hastie, Wadsworth & Brooks/Cole.
Therneau, T., Grambsch, P., Modeling Survival Data: Extending the Cox Model. Springer-Verlag, 2000.
Kassambara A, Kosinski M, Biecek P (2021). survminer: Drawing Survival Curves using 'ggplot2', R package version 0.4.9, <https://CRAN.R-project.org/package=survminer>.
Examples
# Load in data sets:
data("datlist", package = "csmpv")
tdat = datlist$training
# The confirmVars function saves files locally. You can define your own temporary directory.
# If not, tempdir() can be used to get the system's temporary directory.
temp_dir = tempdir()
# As an example, let's define Xvars, which will be used later:
Xvars = c("highIPI","B.Symptoms", "MYC.IHC", "BCL2.IHC", "CD10.IHC", "BCL6.IHC")
# confirmVars can work with three different outcome types.
# Here, we use binary as an example:
bconfirm = confirmVars(data = tdat, biomks = Xvars, Y = "DZsig",
outfile = paste0(temp_dir, "/confirmBinary"))
# You might save the files to the directory you want.
# To delete the temp_dir, use the following:
unlink(temp_dir)