% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/phreg.R
\name{strata-numeric}
\alias{strata-numeric}
\alias{sumstrata}
\alias{cumsumstrata}
\alias{revcumsumstrata}
\alias{revcumsum}
\alias{matdoubleindex}
\alias{mdi}
\title{Stratified Cumulative and Summary Operations}
\usage{
sumstrata(x, strata, nstrata)

cumsumstrata(x, strata, nstrata)

revcumsumstrata(x, strata, nstrata)

revcumsum(x)

matdoubleindex(x, rows, cols, xvec = NULL)

mdi(x, ...)
}
\arguments{
\item{x}{numeric vector (or matrix for \code{matdoubleindex}).}

\item{strata}{integer vector of strata indices (0-based).}

\item{nstrata}{number of distinct strata.}

\item{rows}{row indices for \code{matdoubleindex}.}

\item{cols}{column indices for \code{matdoubleindex}.}

\item{xvec}{optional values to assign at indexed positions.}

\item{...}{additional arguments (for \code{mdi}).}
}
\value{
Numeric vector of the same length as \code{x} (or modified matrix).
}
\description{
Low-level helper functions for computing sums, cumulative sums, and
reverse cumulative sums within strata groups, as well as matrix
double-indexing.
}
\author{
Klaus K. Holst, Thomas Scheike
}
