% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/draw.kaplan.R
\name{separate2GroupsCox}
\alias{separate2GroupsCox}
\title{Separate data in High and Low risk groups (based on Cox model)}
\usage{
separate2GroupsCox(chosen.btas, xdata, ydata, probs = c(0.5, 0.5),
  no.plot = FALSE, plot.title = "SurvivalCurves", xlim = NULL,
  ylim = NULL, expand.yzero = FALSE, legend.outside = FALSE, ...)
}
\arguments{
\item{chosen.btas}{list of testing coefficients to calculate prognostic
indexes, for example ``list(Age = some_vector)``}

\item{xdata}{n x m matrix with n observations and m variables}

\item{ydata}{Survival object}

\item{probs}{How to separate high and low risk patients 50\%-50\% is the
default, but for top and bottom 40\% -> c(.4,.6)}

\item{no.plot}{Only calculate p-value and do not generate survival curve plot}

\item{plot.title}{Name of file if}

\item{xlim}{Optional argument to limit the x-axis view}

\item{ylim}{Optional argument to limit the y-axis view}

\item{expand.yzero}{expand to y = 0}

\item{legend.outside}{If TRUE legend will be outside plot, otherwise inside}

\item{...}{additional parameters to survminer::ggsurvplot}
}
\value{
object with logrank test and kaplan-meier survival plot

A list with plot, p-value and kaplan-meier object. The plot was drawn from
survminer::ggsurvplot with only the palette, data and fit arguments being
defined and keeping all other defaults that can be customized as additional
parameters to this function.
}
\description{
Draws multiple kaplan meyer survival curves (or just 1) and calculates
logrank test
}
\examples{
data('ovarian', package = 'survival')
xdata <- ovarian[,c('age', 'resid.ds')]
ydata <- data.frame(time = ovarian$futime, status = ovarian$fustat)
separate2GroupsCox(c(age = 1, 0), xdata, ydata)
separate2GroupsCox(c(age = 1, 0.5), xdata, ydata)
separate2GroupsCox(c(age = 1), c(1,0,1,0,1,0),
                   data.frame(time = runif(6), status = rbinom(6, 1, .5)))
separate2GroupsCox(list(aa = c(age = 1, 0.5),
                        bb = c(age = 0, 1.5)), xdata, ydata)
}
\seealso{
survminer::ggsurvplot
}
