View source: R/BinomialModel.R
| ProcessingData | R Documentation |
Preprocesses data for binomial or survival analysis. Aligns and filters data based on sample IDs, optionally scales data, and ensures appropriate data types. Handles missing values by removing columns with NA values.
ProcessingData(x, y, scale, type = c("binomial", "survival"))
x |
Data frame of predictors with first column as IDs. |
y |
Data frame of outcomes with first column as IDs. For survival, expects two additional columns for time and status. |
scale |
Logical indicating whether to scale predictors. |
type |
Character string: '"binomial"' or '"survival"'. |
List containing:
Processed predictor matrix
Processed outcome variable
Sample IDs
x <- data.frame(ID = 1:10, predictor1 = rnorm(10), predictor2 = rnorm(10))
y <- data.frame(ID = 1:10, outcome = sample(c(0, 1), 10, replace = TRUE))
result <- ProcessingData(x, y, scale = TRUE, type = "binomial")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.