\SweaveOpts{results=verbatim,keep.source=TRUE,include=FALSE,eps=FALSE,prefix.string=./splx}
\documentclass[a4paper,dvipsnames,twoside,12pt]{report}

% ----------------------------------------------------------------------
% General information for the title page and the page headings
\newcommand{\Title}{Cutting at multiple events:
  \texttt{mcutLexis}\\Multiple microvascular complications}
\newcommand{\Tit}{\texttt{mcutLexis}}
\newcommand{\Version}{Draft version 2}
\newcommand{\Dates}{February 2017}
\newcommand{\Where}{SDCC, Melbourne}
\newcommand{\Homepage}{\url{http://bendixcarstensen.com/SDC/lbh} }
\newcommand{\Faculty}{\begin{tabular}{rl}
Bendix Carstensen
  & Steno Diabetes Center, Gentofte, Denmark\\
  & {\small \& Department of Biostatistics,
               University of Copenhagen} \\
  & \email{bcar0029@regionh.dk} \quad \email{b@bxc.dk} \\
  & \url{http://BendixCarstensen.com} \\[1em]
                      \end{tabular}}

\input{/home/bendix/util/tex/topreport}
\renewcommand{\rwpre}{./splx}

\chapter{Multiple splits}

When you have multiple events of interest you would like  handy way of
setting up a cut Lexis objects where the sojourn time is subdivided
according to the history of events.

The following is mostly R-code leading up to the definition of \texttt{mcutLexis}. 

\SweaveInput{splx}

\chapter{Exercises}
 
\begin{enumerate}
\item Try and see what happens if you run the code with the argument
  \texttt{seq.states=TRUE}
\item Modify the Lexis object so that there are 4 death states, dead
  with 0, 1, 2 or 3 complications. \textit{Hint:} For the records with
  \texttt{lex.Xst=="Dead"} rename \texttt{lex.Xst} according to the
  corresponding value of \texttt{lex.Cst}.
\item Modify the plot to make it more legible w.r.t. mortality rates.
\item Put colors on arrows and rates, and move them along the arrows
  so that they can be read. \textit{Hint:} Put the results of
  \texttt{boxes} in an object (which will be of class \texttt{MS}),
  print it, modify it and use the modified object as input to
  \texttt{boxes.MS}.
\item Split time using \texttt{splitLexis} in say 3-month intervals.
\item Fit relevant models for the rates, using \texttt{lex.Cst} as
  time-dependent covariate. Remember the outcome specification must
  also include \texttt{lex.Cst!=lex.Xst}, and not only specification of
  a range of values for \texttt{lex.Xst} --- why?
\item Use \texttt{grep} to make an elegant construct of the outcome
  value for \texttt{lex.Xst} in analyses.
\item Put it all in a pdf document that will look the same wherever it
  is printed.
\end{enumerate}

% \renewcommand{\bibname}{References}
% \bibliographystyle{plain}
% \bibliography{%
% /home/bendix/art/bibtex/BxC,%
% /home/bendix/art/bibtex/Stat,%
% /home/bendix/art/bibtex/DMCa,%
% /home/bendix/art/bibtex/Diabetes%
% }
% \addcontentsline{toc}{section}{\bibname}

\end{document}
