Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

Revision b58cc9cd586b6c8ac55b26c2da679f538ec801cc authored by Mark Clements on 17 October 2022, 13:50:02 UTC, committed by cran-robot on 17 October 2022, 13:50:02 UTC
version 1.5.8
1 parent dbf475c
  • Files
  • Changes
  • c88d9f4
  • /
  • man
  • /
  • markov_sde.Rd
Raw File Download

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • revision
  • directory
  • content
revision badge
swh:1:rev:b58cc9cd586b6c8ac55b26c2da679f538ec801cc
directory badge
swh:1:dir:a1370f024583becfcae914c1082f8f8665bb7881
content badge
swh:1:cnt:18941d0a6084579e3d223fcb9cf50266e7b0d3a1

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • revision
  • directory
  • content
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
markov_sde.Rd
\name{markov_sde}
\alias{markov_sde}
\alias{standardise.markov_sde}
\alias{plot.markov_sde}
\alias{as.data.frame.markov_sde}
\title{
Predictions for continuous time, nonhomogeneous Markov multi-state
models using Aalen's additive hazards models.
}
\description{
A numerically efficient algorithm to calculate predictions from a
continuous time, nonhomogeneous Markov multi-state model. The main
inputs are are a list of Aalen's additive hazards models, the initial values,
the transition matrix and the covariate patterns. The predictions
include state occupancy probabilities and length of stay. Standard errors are calculated
using the delta method. Includes differences and standardisation.
}
\usage{
markov_sde(models, trans, newdata, init = NULL, nLebesgue = 10000 + 1, los = FALSE,
           nOut = 300, weights = 1)
\method{standardise}{markov_sde}(x, \dots)
\method{plot}{markov_sde}(x, y, stacked=TRUE, which=c("P","L"), index=NULL,
    xlab="Time", ylab=NULL, col=2:6, border=col,
    ggplot2=FALSE, lattice=FALSE, alpha=0.2,
    strata=NULL,
    \dots)
\method{as.data.frame}{markov_sde}(x, row.names=NULL, optional=NULL, ci=TRUE,
    P.conf.type="logit", L.conf.type="log",
    P.range=c(0,1), L.range=c(0,Inf),
    \dots)
}
\arguments{
  \item{models}{
list of models. Currently allows only for \code{\link[timereg]{aalen}} regression models.
}
  \item{trans}{
Transition matrix describing the states and transitions
  in the multi-state model. If S is the number of states in the
  multi-state model, \code{trans} should be an S x S matrix,
  with (i,j)-element a positive integer if a transition from i to j
  is possible in the multi-state model, \code{NA} otherwise. In particular,
  all diagonal elements should be \code{NA}. The
  integers indicating the possible transitions in the multi-state
  model should be sequentially numbered, 1,\ldots,K, with K the number
  of transitions. See \code{\link[mstate]{msprep}}
}
  \item{newdata}{
\code{\link{data.frame}} of the covariates to use in the predictions
}
  \item{init}{
vector of the initial values with the same length as the number of states. Defaults to the first state having an
initial value of 1 (i.e. \code{"[<-"(rep(0,nrow(trans)),1,1)}).
}
  \item{nLebesgue}{
Number of steps for the continuous integration
}
  \item{los}{
logical variable for whether to estimate the length of stay
}
  \item{nOut}{
number of rows to represent the continuous changes
}
  \item{weights}{
numeric vector to represent differences or standardisation
}

For \code{plot.markov_sde}:

\item{y}{(currently ignored)}
\item{stacked}{logical for whether to stack the plots. Default: TRUE}
\item{index}{indicator of which row of \code{newdata} to plot}
\item{which}{character to indicate either transition probabilities (\code{"P"}) or length of stay (\code{"L"})). Default: \code{"P"}.}
\item{xlab}{x-axis label}
\item{ylab}{x-axis label}
\item{col}{colours (ignored if \code{ggplot2=TRUE})}
\item{border}{border colours for the \code{\link{polygon}} (ignored if \code{ggplot=TRUE})}
\item{ggplot2}{use \code{ggplot2}}
\item{alpha}{alpha value for confidence bands (ggplot)}
\item{lattice}{use \code{lattice}}
\item{strata}{formula for the stratification factors for the plot}

For \code{as.data.frame.markov_sde}:

\item{row.names}{add in row names to the output data-frame}
\item{optional}{(not currently used)}
\item{ci}{logical for whether to include confidence intervals. Default:
TRUE}
\item{P.conf.type}{type of transformation for the confidence interval
calculation for the state occupancy probabilities. Default: logit transformation. This is changed to \code{"identity"} if any of the weights are negative}
\item{L.conf.type}{type of transformation for the confidence interval
calculation for the length of stay calculation. Default: log transformation. \code{"identity"} if any of the weights are negative}
\item{P.range}{valid values for the state occupancy probabilities. Default: (0,1). }
\item{L.range}{valid values for the state occupancy probabilities. Default: (0,Inf). }

For \code{standardise.markov_sde}:
\item{x}{object to extract standardised values}

  \item{\dots}{
other arguments. For \code{plot.markov_sde}, these arguments are passed to \code{\link{plot.default}}. For \code{standardise.markov_sde}, these arguments are not used, as the standardisation must be done earlier in \code{markov_sde}.
  }
}
\details{
Uses an approach developed by Ryalen and colleagues. This is a re-implementation in C++.

The current implementation only allows for a vector of initial
values rather than a matrix. The predictions will need to be re-run for
different vectors of initial values.

}
\value{
  \code{markov_sde} returns an object of \code{\link{class}} \code{"markov_sde"}.
}
%% \references{
%% %% ~put references to the literature/web site here ~
%% }
\author{
Mark Clements
}
%% \note{
%% %%  ~~further notes~~
%% }

%% ~Make other sections like Warning with \section{Warning }{....} ~

\seealso{
\code{\link{markov_msm}}
}
%% \examples{

%% }
% Add one or more standard keywords, see file 'KEYWORDS' in the
% R documentation directory (show via RShowDoc("KEYWORDS")):
% \keyword{ ~kwd1 }
% \keyword{ ~kwd2 }
% Use only one keyword per line.
% For non-standard keywords, use \concept instead of \keyword:
% \concept{ ~cpt1 }
% \concept{ ~cpt2 }
% Use only one concept per line.
The diff you're trying to view is too large. Only the first 1000 changed files have been loaded.
Showing with 0 additions and 0 deletions (0 / 0 diffs computed)
swh spinner

Computing file changes ...

back to top

Software Heritage — Copyright (C) 2015–2026, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Content policy— Contact— JavaScript license information— Web API