% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/stabilityIndex.R
\name{stability}
\alias{stability}
\title{Stability index.}
\usage{
stability(data, k = 5, bs = 100, getImages = TRUE, label = NULL,
  path = NULL)
}
\arguments{
\item{data}{A \code{\link{SummarizedExperiment}}.
The SummarizedExperiment must contain an assay with the following structure:
A valid header with names. The first  column of the header is the ID or name
of the instance of the dataset (e.g., ontology, pathway, etc.) on which the
metrics are measured.
The other columns of the header contains the names of the metrics.
The rows contains the measurements of the metrics for each instance in the dataset.}

\item{k}{Positive integer. Number of clusters between [2,15] range.}

\item{bs}{Positive integer. Bootstrap value to perform the resampling.}

\item{getImages}{Boolean. If true, a plot is displayed.}

\item{label}{String. If not NULL, the label will appear on the title of the plots.}

\item{path}{String. Path to a valid directory where plots are saved.}
}
\value{
A \code{\link{SummarizedExperiment}},
containing an assay with the stability measurements and means for 1 to k clusters.
}
\description{
This analysis permits to estimate whether the clustering is meaningfully
affected by small variations in the sample. First, a clustering using the
k-means algorithm is carried out. The value of \code{k} can be provided by the user.
Then, the stability index is the mean of the Jaccard coefficient
values of a number of \code{bs} bootstrap replicates. The values are in the range [0,1],
having the following meaning:
\itemize{
\item Unstable: [0, 0.60[.
\item Doubtful: [0.60, 0.75].
\item Stable: ]0.75, 0.85].
\item Highly Stable: ]0.85, 1].
}
}
\examples{
# Using example data from our package
metrics <- loadSample("ont-metrics")
result <- stability(data=metrics, k=4, getImages=TRUE)
result <- stability(metrics, k=6, getImages=FALSE)
result <- stability(metrics, k=6, getImages=TRUE, label="Experiment 1:")

}
\references{
\insertRef{milligan1996measuring}{evaluomeR}

\insertRef{jaccard1901distribution}{evaluomeR}
}