% Options for packages loaded elsewhere
\PassOptionsToPackage{unicode}{hyperref}
\PassOptionsToPackage{hyphens}{url}
%
\begin{filecontents*}{\jobname.xmpdata}
  \Title{Calculating lifetime cancer risk in a population}
  \Author{Karl Pettersson}
  \Language{en}
\end{filecontents*}
\documentclass[
  english,
]{article}
\usepackage{luatex85} % Otherwise, it will complain about \pdfminorversion missing when using luatex > 0.85.
\usepackage[a-2a]{pdfx}
\usepackage{lmodern}
\usepackage{amssymb,amsmath}
\usepackage{ifxetex,ifluatex}
\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
  \usepackage[T1]{fontenc}
  \usepackage[utf8]{inputenc}
  \usepackage{textcomp} % provide euro and other symbols
\else % if luatex or xetex
  \usepackage{unicode-math}
  \defaultfontfeatures{Scale=MatchLowercase}
  \defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1}
\fi
% Use upquote if available, for straight quotes in verbatim environments
\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
\IfFileExists{microtype.sty}{% use microtype if available
  \usepackage[]{microtype}
  \UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
}{}
\makeatletter
\@ifundefined{KOMAClassName}{% if non-KOMA class
  \IfFileExists{parskip.sty}{%
    \usepackage{parskip}
  }{% else
    \setlength{\parindent}{0pt}
    \setlength{\parskip}{6pt plus 2pt minus 1pt}}
}{% if KOMA class
  \KOMAoptions{parskip=half}}
\makeatother
\usepackage{xcolor}
\IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available
\IfFileExists{bookmark.sty}{\usepackage{bookmark}}{\usepackage{hyperref}}
\hypersetup{
  pdftitle={Calculating lifetime cancer risk in a population},
  pdfauthor={Karl Pettersson},
  pdflang={en},
  hidelinks,
  pdfcreator={LaTeX via pandoc}}
\urlstyle{same} % disable monospaced font for URLs
\usepackage{color}
\usepackage{fancyvrb}
\newcommand{\VerbBar}{|}
\newcommand{\VERB}{\Verb[commandchars=\\\{\}]}
\DefineVerbatimEnvironment{Highlighting}{Verbatim}{commandchars=\\\{\}}
% Add ',fontsize=\small' for more characters per line
\newenvironment{Shaded}{}{}
\newcommand{\AlertTok}[1]{\textcolor[rgb]{1.00,0.00,0.00}{\textbf{#1}}}
\newcommand{\AnnotationTok}[1]{\textcolor[rgb]{0.38,0.63,0.69}{\textbf{\textit{#1}}}}
\newcommand{\AttributeTok}[1]{\textcolor[rgb]{0.49,0.56,0.16}{#1}}
\newcommand{\BaseNTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{#1}}
\newcommand{\BuiltInTok}[1]{#1}
\newcommand{\CharTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{#1}}
\newcommand{\CommentTok}[1]{\textcolor[rgb]{0.38,0.63,0.69}{\textit{#1}}}
\newcommand{\CommentVarTok}[1]{\textcolor[rgb]{0.38,0.63,0.69}{\textbf{\textit{#1}}}}
\newcommand{\ConstantTok}[1]{\textcolor[rgb]{0.53,0.00,0.00}{#1}}
\newcommand{\ControlFlowTok}[1]{\textcolor[rgb]{0.00,0.44,0.13}{\textbf{#1}}}
\newcommand{\DataTypeTok}[1]{\textcolor[rgb]{0.56,0.13,0.00}{#1}}
\newcommand{\DecValTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{#1}}
\newcommand{\DocumentationTok}[1]{\textcolor[rgb]{0.73,0.13,0.13}{\textit{#1}}}
\newcommand{\ErrorTok}[1]{\textcolor[rgb]{1.00,0.00,0.00}{\textbf{#1}}}
\newcommand{\ExtensionTok}[1]{#1}
\newcommand{\FloatTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{#1}}
\newcommand{\FunctionTok}[1]{\textcolor[rgb]{0.02,0.16,0.49}{#1}}
\newcommand{\ImportTok}[1]{#1}
\newcommand{\InformationTok}[1]{\textcolor[rgb]{0.38,0.63,0.69}{\textbf{\textit{#1}}}}
\newcommand{\KeywordTok}[1]{\textcolor[rgb]{0.00,0.44,0.13}{\textbf{#1}}}
\newcommand{\NormalTok}[1]{#1}
\newcommand{\OperatorTok}[1]{\textcolor[rgb]{0.40,0.40,0.40}{#1}}
\newcommand{\OtherTok}[1]{\textcolor[rgb]{0.00,0.44,0.13}{#1}}
\newcommand{\PreprocessorTok}[1]{\textcolor[rgb]{0.74,0.48,0.00}{#1}}
\newcommand{\RegionMarkerTok}[1]{#1}
\newcommand{\SpecialCharTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{#1}}
\newcommand{\SpecialStringTok}[1]{\textcolor[rgb]{0.73,0.40,0.53}{#1}}
\newcommand{\StringTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{#1}}
\newcommand{\VariableTok}[1]{\textcolor[rgb]{0.10,0.09,0.49}{#1}}
\newcommand{\VerbatimStringTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{#1}}
\newcommand{\WarningTok}[1]{\textcolor[rgb]{0.38,0.63,0.69}{\textbf{\textit{#1}}}}
\usepackage{longtable,booktabs}
% Correct order of tables after \paragraph or \subparagraph
\usepackage{etoolbox}
\makeatletter
\patchcmd\longtable{\par}{\if@noskipsec\mbox{}\fi\par}{}{}
\makeatother
% Allow footnotes in longtable head/foot
\IfFileExists{footnotehyper.sty}{\usepackage{footnotehyper}}{\usepackage{footnote}}
\makesavenoteenv{longtable}
\usepackage{graphicx}
\makeatletter
\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi}
\def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi}
\makeatother
% Scale images if necessary, so that they will not overflow the page
% margins by default, and it is still possible to overwrite the defaults
% using explicit options in \includegraphics[width, height, ...]{}
\setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
% Set default figure placement to htbp
\makeatletter
\def\fps@figure{htbp}
\makeatother
\setlength{\emergencystretch}{3em} % prevent overfull lines
\providecommand{\tightlist}{%
  \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
\setcounter{secnumdepth}{-\maxdimen} % remove section numbering
\ifxetex
  % Load polyglossia as late as possible: uses bidi with RTL langages (e.g. Hebrew, Arabic)
  \usepackage{polyglossia}
  \setmainlanguage[]{english}
\else
  \usepackage[shorthands=off,main=english]{babel}
\fi
\newlength{\cslhangindent}
\setlength{\cslhangindent}{1.5em}
\newenvironment{cslreferences}%
  {\setlength{\parindent}{0pt}%
  \everypar{\setlength{\hangindent}{\cslhangindent}}\ignorespaces}%
  {\par}
\title{Calculating lifetime cancer risk in a population}
\author{Karl Pettersson}
\date{}
\AtBeginDocument{\tagstructbegin{tag=Document}}
\AtEndDocument{\tagstructend}
\pretocmd{\maketitle}{\tagstructbegin{tag=H1}\tagmcbegin{tag=H1}}{}{}
\apptocmd{\maketitle}{\tagmcend\tagstructend}{}{}
\usepackage{tagpdf}
\tagpdfsetup{
 activate-all,
 uncompress,
 tabsorder=structure,
 interwordspace=true
 }
\begin{document}
\maketitle
{
\tagstructbegin{tag=H1}\tagmcbegin{tag=H1}
\hypertarget{introduction}{%
\section{Introduction}\label{introduction}}
\leavevmode\tagmcend\tagstructend
\tagstructbegin{tag=P}\tagmcbegin{tag=P}
It is common to hear statements such as
\leavevmode\tagmcend\tagstructend\par
\tagstructbegin{tag=L}
\begin{description}
\item[\tagstructbegin{tag=LI}\tagstructbegin{tag=Lbl}\tagmcbegin{tag=Lbl}One
in three\tagmcend\tagstructend]
\tagstructbegin{tag=LBody}\tagmcbegin{tag=P}
One in three persons will develop cancer during their lifetime.
\tagmcend\tagstructend\tagstructend
\item[\tagstructbegin{tag=LI}\tagstructbegin{tag=Lbl}\tagmcbegin{tag=Lbl}One
in nine\tagmcend\tagstructend]
\tagstructbegin{tag=LBody}\tagmcbegin{tag=P}
One in nine women will develop breast cancer.
\tagmcend\tagstructend\tagstructend
\end{description}
\tagstructend
\tagstructbegin{tag=P}\tagmcbegin{tag=P}
Most often, such statements are based on a simple calculation of
cumulative risk, i.e.~age-specific incidence rates for a given year and
cancer diagnosis are summed up to a chosen maximum age, e.g.~75 years,
and the resulting cumulative incidence rate
{\tagstructbegin{tag=Formula}\tagmcbegin{tag=Formula}\(r\)\leavevmode\tagmcend\tagstructend}
is then converted into a probability using the formula
{\tagstructbegin{tag=Formula}\tagmcbegin{tag=Formula}\(1-\exp(-r)\)\leavevmode\tagmcend\tagstructend}.
However, if ``lifetime cancer risk'' is interpreted as the proportion of
the population which will be diagnosed with cancer during their
lifetime, this method gives incorrect results, because it does not take
the following into account:
\leavevmode\tagmcend\tagstructend\par
\tagstructbegin{tag=L}
\begin{enumerate}
\def\labelenumi{\arabic{enumi}.}
\item
  \tagstructbegin{tag=LI}\tagstructbegin{tag=LBody}\tagmcbegin{tag=P}
  Future changes in cancer rates.
  \tagmcend\tagstructend\tagstructend
\item
  \tagstructbegin{tag=LI}\tagstructbegin{tag=LBody}\tagmcbegin{tag=P}
  People who die before they reach the maximum age, due to causes
  unrelated to cancer.
  \tagmcend\tagstructend\tagstructend
\item
  \tagstructbegin{tag=LI}\tagstructbegin{tag=LBody}\tagmcbegin{tag=P}
  People who develop cancer at ages above the maximum age.
  \tagmcend\tagstructend\tagstructend
\item
  \tagstructbegin{tag=LI}\tagstructbegin{tag=LBody}\tagmcbegin{tag=P}
  People who are diagnosed with multiple primary cancers during their
  lifetime.
  \tagmcend\tagstructend\tagstructend
\end{enumerate}
\tagstructend
\tagstructbegin{tag=H1}\tagmcbegin{tag=H1}
\hypertarget{the-amp-method}{%
\section{The AMP method}\label{the-amp-method}}
\leavevmode\tagmcend\tagstructend
\tagstructbegin{tag=P}\tagmcbegin{tag=P}
The first problem will not be further discussed in this post, as dealing
with it obviously would require projections into the future. The other
problems can be assessed with a method described by
{\tagstructbegin{tag=Reference}\tagmcbegin{tag=Reference}Sasieni et al.
(2011)\leavevmode\tagmcend\tagstructend}, which they call AMP
(``adjusted for multiple primaries''), and which only requires routinely
available data. Their idea is to build a life table where it is possible
to be eliminated from the population either by being diagnosed with
cancer or by dying from something other than cancer. It is then possible
to calculate the proportions eliminated in these different ways. The AMP
method hinges on the independence assumption that primary cancer
incidence and mortality from causes other than cancer are the same among
people who have had cancer as in the general population, because these
groups cannot normally be differentiated in official statistics. Only
the following data are required:
\leavevmode\tagmcend\tagstructend\par
\tagstructbegin{tag=L}
\begin{enumerate}
\def\labelenumi{\arabic{enumi}.}
\item
  \tagstructbegin{tag=LI}\tagstructbegin{tag=LBody}\tagmcbegin{tag=P}
  Age-specific population size, in order to calculate incidence and
  mortality rates.
  \tagmcend\tagstructend\tagstructend
\item
  \tagstructbegin{tag=LI}\tagstructbegin{tag=LBody}\tagmcbegin{tag=P}
  Age-specific number of cancer cases.
  \tagmcend\tagstructend\tagstructend
\item
  \tagstructbegin{tag=LI}\tagstructbegin{tag=LBody}\tagmcbegin{tag=P}
  Age-specific number of deaths due to all causes.
  \tagmcend\tagstructend\tagstructend
\item
  \tagstructbegin{tag=LI}\tagstructbegin{tag=LBody}\tagmcbegin{tag=P}
  Age-specific number of deaths due cancer. Note that official
  statistics normally reports so-called underlying causes of deaths,
  which means that this should include complications of cancer and
  cancer treatment (otherwise, the independence assumption given above
  would be violated).
  \tagmcend\tagstructend\tagstructend
\end{enumerate}
\tagstructend
\tagstructbegin{tag=P}\tagmcbegin{tag=P}
Using my LifeTable package,
{\tagstructbegin{tag=Link}\tagmcbegin{tag=Link}\url{https://github.com/klpn/LifeTable.jl}\leavevmode\tagmcend\tagstructend},
the AMP method can be easily implemented in Julia. I will give examples
with calculations for Sweden 2014, using data from
{\tagstructbegin{tag=Reference}\tagmcbegin{tag=Reference}Statistics
Sweden (2016)\leavevmode\tagmcend\tagstructend} for population size,
{\tagstructbegin{tag=Reference}\tagmcbegin{tag=Reference}National Board
of Health and Welfare (2019a)\leavevmode\tagmcend\tagstructend} for
cancer cases and
{\tagstructbegin{tag=Reference}\tagmcbegin{tag=Reference}National Board
of Health and Welfare (2019b)\leavevmode\tagmcend\tagstructend} for
deaths. The data are given in 5-year age intervals from 0--4 to 80--84
years, with an open interval for ages above 85 years. The files used in
the example are available via a gist,
{\tagstructbegin{tag=Link}\tagmcbegin{tag=Link}\url{https://gist.github.com/klpn/3ab1feff67d6e938fecc61c8307ce394}\leavevmode\tagmcend\tagstructend}.
The Julia file,
{\tagstructbegin{tag=Link}\tagmcbegin{tag=Link}\url{https://gist.github.com/klpn/3ab1feff67d6e938fecc61c8307ce394\#file-amplt-jl}\leavevmode\tagmcend\tagstructend}
contains the following code:
\leavevmode\tagmcend\tagstructend\par
\tagstructbegin{tag=Code}\tagmcbegin{tag=Code}
\begin{Shaded}
\begin{Highlighting}[numbers=left,,]
\KeywordTok{using}\NormalTok{ LifeTable}\OperatorTok{,}\NormalTok{ DataFrames}
\KeywordTok{function}\NormalTok{ AmpLt(inframe}\OperatorTok{,}\NormalTok{ sex}\OperatorTok{,}\NormalTok{ rate }\OperatorTok{=} \StringTok{"inc"}\NormalTok{)}
\NormalTok{    age }\OperatorTok{=}\NormalTok{ inframe[}\FloatTok{1}\NormalTok{]}
\NormalTok{    pop }\OperatorTok{=}\NormalTok{ inframe[}\FloatTok{2}\NormalTok{]}
\NormalTok{    acd }\OperatorTok{=}\NormalTok{ inframe[}\FloatTok{3}\NormalTok{]}
\NormalTok{    cd }\OperatorTok{=}\NormalTok{ inframe[}\FloatTok{4}\NormalTok{]}
\NormalTok{    cc }\OperatorTok{=}\NormalTok{ inframe[}\FloatTok{5}\NormalTok{]}
    \KeywordTok{if}\NormalTok{ rate }\OperatorTok{==} \StringTok{"inc"}
\NormalTok{        ncol }\OperatorTok{=}\NormalTok{ cc}
\NormalTok{        dcol }\OperatorTok{=}\NormalTok{ acd .}\OperatorTok{{-}}\NormalTok{ cd .}\OperatorTok{+}\NormalTok{ cc}
    \KeywordTok{elseif}\NormalTok{ rate }\OperatorTok{==} \StringTok{"mort"}
\NormalTok{        ncol }\OperatorTok{=}\NormalTok{ cd}
\NormalTok{        dcol }\OperatorTok{=}\NormalTok{ acd}
    \KeywordTok{end}
\NormalTok{    df }\OperatorTok{=}\NormalTok{ DataFrame(age }\OperatorTok{=}\NormalTok{ age}\OperatorTok{,}\NormalTok{ pop }\OperatorTok{=}\NormalTok{ pop}\OperatorTok{,}\NormalTok{ dcol }\OperatorTok{=}\NormalTok{ dcol)}
\NormalTok{    cprop }\OperatorTok{=}\NormalTok{ ncol }\OperatorTok{./}\NormalTok{ dcol }
\NormalTok{    lt }\OperatorTok{=}\NormalTok{ PeriodLifeTable(df}\OperatorTok{,}\NormalTok{ sex)}
    \KeywordTok{return}\NormalTok{ CauseLife(lt}\OperatorTok{,}\NormalTok{ cprop)}
\KeywordTok{end}
\end{Highlighting}
\end{Shaded}
\leavevmode\tagmcend\tagstructend
\tagstructbegin{tag=P}\tagmcbegin{tag=P}
Assuming the LifeTable package is installed and the files have been
downloaded, you can calculate tables with lifetime cancer risk for
Swedish females and males, at a given age:
\leavevmode\tagmcend\tagstructend\par
\tagstructbegin{tag=Code}\tagmcbegin{tag=Code}
\begin{Shaded}
\begin{Highlighting}[numbers=left,,]
\NormalTok{include(}\StringTok{"amplt.jl"}\NormalTok{)}
\NormalTok{fse14 }\OperatorTok{=}\NormalTok{ readtable(}\StringTok{"fse14.csv"}\NormalTok{)}
\NormalTok{mse14 }\OperatorTok{=}\NormalTok{ readtable(}\StringTok{"mse14.csv"}\NormalTok{)}
\NormalTok{ampfse14 }\OperatorTok{=}\NormalTok{ AmpLt(fse14}\OperatorTok{,} \FloatTok{2}\NormalTok{)}
\NormalTok{ampmse14 }\OperatorTok{=}\NormalTok{ AmpLt(mse14}\OperatorTok{,} \FloatTok{1}\NormalTok{)}
\end{Highlighting}
\end{Shaded}
\leavevmode\tagmcend\tagstructend
\tagstructbegin{tag=P}\tagmcbegin{tag=P}
The first row in the \texttt{f} column in a frame returned by
\texttt{AmpLt} gives the lifetime cancer risk at birth, which should be
about 45.7 percent for females and 49.3 percent for males. It is also
possible to calculate lifetime risk for cancer mortality, rather than
incidence:
\leavevmode\tagmcend\tagstructend\par
\tagstructbegin{tag=Code}\tagmcbegin{tag=Code}
\begin{Shaded}
\begin{Highlighting}[numbers=left,,]
\NormalTok{mampfse14 }\OperatorTok{=}\NormalTok{ AmpLt(fse14}\OperatorTok{,} \FloatTok{2}\OperatorTok{,} \StringTok{"mort"}\NormalTok{)}
\NormalTok{mampmse14 }\OperatorTok{=}\NormalTok{ AmpLt(mse14}\OperatorTok{,} \FloatTok{1}\OperatorTok{,} \StringTok{"mort"}\NormalTok{)}
\end{Highlighting}
\end{Shaded}
\leavevmode\tagmcend\tagstructend
\tagstructbegin{tag=P}\tagmcbegin{tag=P}
The first row in these frames should be about 22.3 and 26.2 percent for
females and males. With PyPlot, the frames can be plotted:
\leavevmode\tagmcend\tagstructend\par
\tagstructbegin{tag=Code}\tagmcbegin{tag=Code}
\begin{Shaded}
\begin{Highlighting}[numbers=left,,]
\NormalTok{plot(ampfse14[}\OperatorTok{:}\NormalTok{age]}\OperatorTok{,}\NormalTok{ ampfse14[}\OperatorTok{:}\NormalTok{f]}\OperatorTok{,}\NormalTok{ label }\OperatorTok{=} \StringTok{"incidence, females"}\NormalTok{)}
\NormalTok{plot(ampfse14[}\OperatorTok{:}\NormalTok{age]}\OperatorTok{,}\NormalTok{ ampmse14[}\OperatorTok{:}\NormalTok{f]}\OperatorTok{,}\NormalTok{ label }\OperatorTok{=} \StringTok{"incidence, males"}\NormalTok{)}
\NormalTok{plot(ampfse14[}\OperatorTok{:}\NormalTok{age]}\OperatorTok{,}\NormalTok{ mampfse14[}\OperatorTok{:}\NormalTok{f]}\OperatorTok{,}\NormalTok{ label }\OperatorTok{=} \StringTok{"mortality, females"}\NormalTok{)}
\NormalTok{plot(ampfse14[}\OperatorTok{:}\NormalTok{age]}\OperatorTok{,}\NormalTok{ mampmse14[}\OperatorTok{:}\NormalTok{f]}\OperatorTok{,}\NormalTok{ label }\OperatorTok{=} \StringTok{"mortality, males"}\NormalTok{)}
\NormalTok{title(}\StringTok{"Lifetime cancer risk Sweden 2014"}\NormalTok{)}
\NormalTok{xlim(}\FloatTok{0}\OperatorTok{,} \FloatTok{85}\NormalTok{)}
\NormalTok{ylim(}\FloatTok{0}\OperatorTok{,} \FloatTok{0.5}\NormalTok{)}
\NormalTok{legend(loc}\OperatorTok{=}\FloatTok{3}\NormalTok{)}
\NormalTok{grid(}\FloatTok{1}\NormalTok{)}
\end{Highlighting}
\end{Shaded}
\leavevmode\tagmcend\tagstructend
\tagstructbegin{tag=Figure,alttext={Lifetime probability of cancer in Sweden 2014}}\tagmcbegin{tag=Figure}
\begin{figure}
\centering
\includegraphics[width=1\textwidth,height=1\textheight]{Se14CancLt.png}
\caption{Lifetime probabilty of cancer incidence and mortality for
Swedish females and males 2014}
\end{figure}
\tagmcend\tagstructend
\tagstructbegin{tag=P}\tagmcbegin{tag=P}
As the chart shows, the probabilities tend to decrease with age,
especially after age 60, which is due to increasing competition from
other causes of death, e.g.~circulatory disorders.
\leavevmode\tagmcend\tagstructend\par
\tagstructbegin{tag=Table}
\begin{longtable}[]{@{}lll@{}}
\caption{\tagmcbegin{tag=Caption}Lifetime probabilty of cancer incidence
and mortality for Swedish females and males
2014.\tagmcend}\tabularnewline
\toprule
\begin{minipage}[b]{0.30\columnwidth}\raggedright
\tagstructbegin{tag=TR}\tagstructbegin{tag=TH}\tagmcbegin{tag=TH}
Measure
\tagmcend\tagstructend\strut
\end{minipage} & \begin{minipage}[b]{0.30\columnwidth}\raggedright
\tagstructbegin{tag=TH}\tagmcbegin{tag=TH}
Female
\tagmcend\tagstructend\strut
\end{minipage} & \begin{minipage}[b]{0.30\columnwidth}\raggedright
\tagstructbegin{tag=TH}\tagmcbegin{tag=TH}
Male
\tagmcend\tagstructend\tagstructend\strut
\end{minipage}\tabularnewline
\midrule
\endfirsthead
\begin{minipage}[t]{0.30\columnwidth}\raggedright
\tagstructbegin{tag=TR}\tagstructbegin{tag=TD}\tagmcbegin{tag=TD}
Incidence
\tagmcend\tagstructend\strut
\end{minipage} & \begin{minipage}[t]{0.30\columnwidth}\raggedright
\tagstructbegin{tag=TD}\tagmcbegin{tag=TD}
45.7
\tagmcend\tagstructend\strut
\end{minipage} & \begin{minipage}[t]{0.30\columnwidth}\raggedright
\tagstructbegin{tag=TD}\tagmcbegin{tag=TD}
49.3
\tagmcend\tagstructend\tagstructend\strut
\end{minipage}\tabularnewline
\begin{minipage}[t]{0.30\columnwidth}\raggedright
\tagstructbegin{tag=TR}\tagstructbegin{tag=TD}\tagmcbegin{tag=TD}
Mortality
\tagmcend\tagstructend\strut
\end{minipage} & \begin{minipage}[t]{0.30\columnwidth}\raggedright
\tagstructbegin{tag=TD}\tagmcbegin{tag=TD}
22.3
\tagmcend\tagstructend\strut
\end{minipage} & \begin{minipage}[t]{0.30\columnwidth}\raggedright
\tagstructbegin{tag=TD}\tagmcbegin{tag=TD}
26.2
\tagmcend\tagstructend\tagstructend\strut
\end{minipage}\tabularnewline
\bottomrule
\end{longtable}
\tagstructend
\tagstructbegin{tag=P}\tagmcbegin{tag=P}
If cancer incidence and mortality are changed, this might also influence
mortality from some non-cancer causes. For example, decreased smoking
tends to decrease lung cancer incidence and mortality, as well as
mortality from nonmalignant respiratory diseases and atherosclerotic
diseases.{\tagstructbegin{tag=Note}\tagmcbegin{tag=Note}\footnote{\tagstructbegin{tag=P}\tagmcbegin{tag=P}
  This shared risk factor can be expected to violate the independence
  assumption in the AMP method to some extent. However, as noted by
  {\tagstructbegin{tag=Reference}\tagmcbegin{tag=Reference}Sasieni et
  al. (2011)\leavevmode\tagmcend\tagstructend}, these effects should not
  be serious when all cancers are studied, because there are few lung
  cancer survivors in the population.
  \leavevmode\tagmcend\tagstructend\par}\leavevmode\tagmcend\tagstructend}
One might ask how such risk factor changes would influence lifetime
cancer risk, which might be decreased, as well as unchanged, or even
increased, due to diminished competition. The following function
recalculate a frame with cancer cases, as well as cancer deaths and
non-cancer deaths, changed by the same factor for all age groups:
\leavevmode\tagmcend\tagstructend\par
\tagstructbegin{tag=Code}\tagmcbegin{tag=Code}
\begin{Shaded}
\begin{Highlighting}[numbers=left,,]
\KeywordTok{function}\NormalTok{ RateChange(inframe}\OperatorTok{,}\NormalTok{ changefac)}
\NormalTok{    ncd }\OperatorTok{=}\NormalTok{ inframe[}\FloatTok{4}\NormalTok{] }\OperatorTok{.*}\NormalTok{ changefac}
\NormalTok{    ncc }\OperatorTok{=}\NormalTok{ inframe[}\FloatTok{5}\NormalTok{] }\OperatorTok{.*}\NormalTok{ changefac}
\NormalTok{    nacd }\OperatorTok{=}\NormalTok{ (inframe[}\FloatTok{3}\NormalTok{].}\OperatorTok{{-}}\NormalTok{inframe[}\FloatTok{4}\NormalTok{])}\OperatorTok{.*}\NormalTok{changefac .}\OperatorTok{+}\NormalTok{ ncd}
    \KeywordTok{return}\NormalTok{ DataFrame(age }\OperatorTok{=}\NormalTok{ inframe[}\FloatTok{1}\NormalTok{]}\OperatorTok{,}\NormalTok{ pop }\OperatorTok{=}\NormalTok{ inframe[}\FloatTok{2}\NormalTok{]}\OperatorTok{,}
\NormalTok{        acd }\OperatorTok{=}\NormalTok{ nacd}\OperatorTok{,}\NormalTok{ cd }\OperatorTok{=}\NormalTok{ ncd}\OperatorTok{,}\NormalTok{ cc }\OperatorTok{=}\NormalTok{ ncc)}
\KeywordTok{end}
\end{Highlighting}
\end{Shaded}
\leavevmode\tagmcend\tagstructend
\tagstructbegin{tag=P}\tagmcbegin{tag=P}
To calculate lifetime cancer risk for Swedish females with all three
rates reduced by one third, give
\texttt{AmpLt(RateChange(fse14,\ 2/3),\ 2)}. The frame returned by this
call gives a lifetime risk at birth of 37.5 percent. For males, the
corresponding risk is 42.6 percent. For mortality, the risks would be
19.2 and 24.0 percent for females and males respectively. If
age-specific cancer incidence and mortality and non-cancer mortality are
reduced by the same factor, in a society such as Sweden, which already
has high life expectancy, this tends to reduce the lifetime risk of
getting cancer or dying from it, because more people will survive to
higher ages where the probability of getting cancer before succumbing to
something else is lower (with greater reductions, the risks at lower
ages asymptotically approach the corresponding risks at the highest age,
i.e.~85 years in this example).
\leavevmode\tagmcend\tagstructend\par
\tagstructbegin{tag=H1}\tagmcbegin{tag=H1}
\hypertarget{references}{%
\section*{References}\label{references}}
\addcontentsline{toc}{section}{References}
\leavevmode\tagmcend\tagstructend
\tagstructbegin{tag=BibEntry}\tagmcbegin{tag=BibEntry}
\hypertarget{refs}{}
\begin{cslreferences}
\tagstructbegin{tag=BibEntry}\tagmcbegin{tag=BibEntry}
\hypertarget{ref-soscanen}{}
\tagstructbegin{tag=P}\tagmcbegin{tag=P}
National Board of Health and Welfare. 2019a. ``Cancer.'' 2019.
{\tagstructbegin{tag=Link}\tagmcbegin{tag=Link}\url{https://sdb.socialstyrelsen.se/if_can/val_eng.aspx}\leavevmode\tagmcend\tagstructend}.
\leavevmode\tagmcend\tagstructend\par
\leavevmode\tagmcend\tagstructend
\tagstructbegin{tag=BibEntry}\tagmcbegin{tag=BibEntry}
\hypertarget{ref-sosdoren}{}
\tagstructbegin{tag=P}\tagmcbegin{tag=P}
---------. 2019b. ``Cause of Death.'' 2019.
{\tagstructbegin{tag=Link}\tagmcbegin{tag=Link}\url{https://sdb.socialstyrelsen.se/if_dor/val_eng.aspx}\leavevmode\tagmcend\tagstructend}.
\leavevmode\tagmcend\tagstructend\par
\leavevmode\tagmcend\tagstructend
\tagstructbegin{tag=BibEntry}\tagmcbegin{tag=BibEntry}
\hypertarget{ref-sasieni11}{}
\tagstructbegin{tag=P}\tagmcbegin{tag=P}
Sasieni, P. D., J. Shelton, N. Ormiston-Smith, C. S. Thomson, and P. B.
Silcocks. 2011. ``What Is the Lifetime Risk of Developing Cancer?: The
Effect of Adjusting for Multiple Primaries.'' \emph{British Journal of
Cancer} 105.
{\tagstructbegin{tag=Link}\tagmcbegin{tag=Link}\url{https://doi.org/10.1038/bjc.2011.250}\leavevmode\tagmcend\tagstructend}.
\leavevmode\tagmcend\tagstructend\par
\leavevmode\tagmcend\tagstructend
\tagstructbegin{tag=BibEntry}\tagmcbegin{tag=BibEntry}
\hypertarget{ref-scbmeanpopen}{}
\tagstructbegin{tag=P}\tagmcbegin{tag=P}
Statistics Sweden. 2016. ``Mean Population by Region, Marital Status,
Age and Sex.'' 2016.
{\tagstructbegin{tag=Link}\tagmcbegin{tag=Link}\url{http://www.statistikdatabasen.scb.se/goto/en/ssd/MedelfolkHandelse}\leavevmode\tagmcend\tagstructend}.
\leavevmode\tagmcend\tagstructend\par
\leavevmode\tagmcend\tagstructend
\end{cslreferences}
\leavevmode\tagmcend\tagstructend
}
\end{document}
