% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/BinomialModel.R
\name{SplitTrainTest}
\alias{SplitTrainTest}
\title{Split Data into Training and Testing Sets}
\usage{
SplitTrainTest(x, y, train_ratio, type = c("binomial", "survival"), seed)
}
\arguments{
\item{x}{Predictor matrix or data frame.}

\item{y}{Outcome vector (binomial) or matrix with time/status (survival).}

\item{train_ratio}{Proportion for training (0-1). Default is `0.7`.}

\item{type}{Analysis type: `"binomial"` or `"survival"`.}

\item{seed}{Random seed for reproducibility.}
}
\value{
List containing:
\describe{
  \item{train.x}{Training predictors matrix}
  \item{train.y}{Training outcomes}
  \item{test.x}{Testing predictors matrix}
  \item{test.y}{Testing outcomes}
  \item{train_sample}{Indices of training samples}
}
}
\description{
Divides dataset into training and testing sets using random sampling.
Maintains data integrity for both binomial and survival analysis types.
}
\examples{
data_matrix <- matrix(rnorm(200), ncol = 2)
outcome_vector <- rbinom(100, 1, 0.5)
split_data <- SplitTrainTest(
  data_matrix, outcome_vector,
  train_ratio = 0.7,
  type = "binomial", seed = 123
)
}
