Commit 384c5e83 authored by Sautreuil Mathilde's avatar Sautreuil Mathilde
Browse files

vig

parent 485dc562
......@@ -40,7 +40,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">survMS</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.0.9000</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.1.0000</span>
</span>
</div>
......@@ -152,18 +152,22 @@
<div id="introduction" class="section level1">
<h1 class="hasAnchor">
<a href="#introduction" class="anchor"></a>1 Introduction</h1>
<<<<<<< HEAD
<p>This package enables us to simulate survival data with several levels of complexity from different survival models: Cox model <span class="citation">(Cox 1972)</span>, the Accelerated Failure Time (AFT) model, and the Accelerated Hazard (AH) model <span class="citation">(Chen and Wang 2000)</span>. WTo simulate data from a Cox model, we consider the procedure of <span class="citation">(Bender, Augustin, and Blettner 2005)</span>. This model is the most popular in survival analysis, but other models exist. The package also enables us to simulate survival data from an AFT model based on <span class="citation">(Leemis, Shih, and Reynertson 1990)</span>. Considering different models for data simulation is interesting because the assumptions associated with these models are different. Indeed, the Cox model is a proportional risk model, not the AFT model. In the AFT model, the variables will have an accelerating or decelerating effect on on individuals’ survival. Despite the survival functions of an AFT model never intersect as in the Cox model. However, having data with intersecting survival curves allows the data to be more complex and makes it more difficult for methods to predict survival. Besides, Cox and AFT models produce data with survival curves not crossing. To have crossing survival curves, we considered two approaches. The first approach consists of modifying the AFT model to have intersecting survival curves. The second approach concerns using an AH model to generate the survival data. The AH model is more flexible than the two models mentioned above. In the AH model, the variables will accelerate or decelerate the instantaneous risk of death. The survival curves of the AH model can therefore cross each other. This package also allows us to simulate survival data from modified AFT and AH models. The generation of survival times carries out from the different models mentioned above. The models’ baseline risk function of the models is assumed to be known and follows a specific probability distribution.</p>
>>>>>>> originGit/main
=======
<p>This package enables us to simulate survival data with several levels of complexity from different survival models: Cox model <span class="citation">(Cox 1972)</span>, the Accelerated Failure Time (AFT) model, and the Accelerated Hazard (AH) model <span class="citation">(Chen and Wang 2000)</span>. To simulate data from a Cox model, we consider the procedure of <span class="citation">(Bender, Augustin, and Blettner 2005)</span>. This model is the most popular in survival analysis, but other models exist. The package also enables us to simulate survival data from an AFT model based on <span class="citation">(Leemis, Shih, and Reynertson 1990)</span>. Considering different models for data simulation is interesting because the assumptions associated with these models are different. Indeed, the Cox model is a proportional risk model, not the AFT model. In the AFT model, the variables will have an accelerating or decelerating effect on on individuals’ survival. Despite the survival functions of an AFT model never intersect as in the Cox model. However, having data with intersecting survival curves allows the data to be more complex and makes it more difficult for methods to predict survival. Besides, Cox and AFT models produce data with survival curves not crossing. To have crossing survival curves, we considered two approaches. The first approach consists of modifying the AFT model to have intersecting survival curves. The second approach concerns using an AH model to generate the survival data. The AH model is more flexible than the two models mentioned above. In the AH model, the variables will accelerate or decelerate the instantaneous risk of death. The survival curves of the AH model can therefore cross each other. This package also allows us to simulate survival data from modified AFT and AH models. The generation of survival times carries out from the different models mentioned above. The models’ baseline risk function of the models is assumed to be known and follows a specific probability distribution.</p>
>>>>>>> originGit/main
<div id="reminder-of-the-functions-used-in-survival-analysis" class="section level2">
<h2 class="hasAnchor">
<a href="#reminder-of-the-functions-used-in-survival-analysis" class="anchor"></a>1.1 Reminder of the functions used in survival analysis</h2>
<p>The table below summarizes the writing of the functions used in survival analysis (instantaneous risk <span class="math inline">\(\lambda(t)\)</span>, cumulative risk function <span class="math inline">\(H_0(t)\)</span>, survival function <span class="math inline">\(S(t)\)</span> and density function <span class="math inline">\(f(t)\)</span>) for each of the models considered (Cox, AFT and AH models).</p>
<table class="table">
<colgroup>
<col width="12%">
<col width="30%">
<col width="10%">
<col width="27%">
<col width="29%">
<col width="24%">
<col width="37%">
</colgroup>
<thead><tr class="header">
<<<<<<< HEAD
......@@ -175,11 +179,17 @@
=======
=======
<th align="center"></th>
<<<<<<< HEAD
>>>>>>> originGit/main
<th align="center">Cox</th>
<th align="center">AFT</th>
<th align="center">AH</th>
>>>>>>> originGit/main
=======
<th align="center">Cox model</th>
<th align="center">Accelerated failure Time model</th>
<th align="center">Accelerated hazard model</th>
>>>>>>> originGit/main
</tr></thead>
<tbody>
<tr class="odd">
......@@ -275,10 +285,15 @@
=======
=======
<th align="center"></th>
<<<<<<< HEAD
>>>>>>> originGit/main
<th align="center">Weibull</th>
<th align="center">Log-normale</th>
>>>>>>> originGit/main
=======
<th align="center">Weibull distribution</th>
<th align="center">Log-normal distribution</th>
>>>>>>> originGit/main
</tr></thead>
<tbody>
<tr class="odd">
......@@ -385,7 +400,7 @@
</tr>
</tbody>
</table>
<p>with <span class="math inline">\(\Gamma\)</span> is the gamma function.</p>
<p>with <span class="math inline">\(\Gamma\)</span> is the gamma function and <span class="math inline">\(\Phi\)</span> is the cumulative distribution function of the standard normal distribution.</p>
<p>The distribution function is deduced from the survival function from the following formula:</p>
<span class="math display">\[\begin{equation}
F(t\mid X) = 1 - S(t\mid X).
......@@ -568,9 +583,10 @@ To simulate the data from the AFT/Log-normal model, we used the procedure detail
<a href="#simulation-from-the-aft-model-with-baseline-hazard-following-weibull-distribution" class="anchor"></a>3.1 Simulation from the AFT model with baseline hazard following Weibull distribution</h2>
For this simulation, we consider that survival times follow a log-normal distribution <span class="math inline">\(\mathcal{W}(a,\lambda).\)</span> In this case, we have the cumulative risk function expressed by:
<span class="math display">\[\begin{equation}
H_0(t) = \lambda t^{a},
H_0(t) = \lambda t^{a}.
\end{equation}\]</span>
where <span class="math inline">\(\Phi(t)\)</span> is the distribution function of the centred and reduced normal distribution. Survival times can therefore be simulated from:
<!-- where $\Phi(t)$ is the distribution function of the centred and reduced normal distribution. -->
Survival times can therefore be simulated from:
<span class="math display">\[\begin{equation}
T = \left( \frac{-\log(1-U)}{\lambda}\right)^{\frac{1}{a}} \exp(-\beta^T X_{i}).
\end{equation}\]</span>
......@@ -681,11 +697,13 @@ T = \frac{1}{\exp(\beta^T X_{i})} \left( \exp(\sigma \Phi^{-1}(U) + \mu) + \beta
<p>with <span class="math inline">\(U \sim \mathcal{U} [0,1].\)</span></p>
<div class="sourceCode"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span class="co"># res_paramLN = get_param_ln(var = 600000, mu = 1134)#compute_param_weibull(a_list = a_list, med = 2280, moy = 2325, var = 1619996)</span>
<span class="va">listAFTsSim_n500_p1000</span> <span class="op">&lt;-</span> <span class="fu"><a href="../reference/modelSim.html">modelSim</a></span><span class="op">(</span>model <span class="op">=</span> <span class="st">"AFTshift"</span>, matDistr <span class="op">=</span> <span class="st">"unif"</span>, matParam <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span><span class="op">(</span><span class="fl">0</span>,<span class="fl">1</span><span class="op">)</span>, n <span class="op">=</span> <span class="fl">500</span>,
p <span class="op">=</span> <span class="fl">100</span>, pnonull <span class="op">=</span> <span class="fl">100</span>, betaDistr <span class="op">=</span> <span class="fl">0.5</span>, hazDistr <span class="op">=</span> <span class="st">"log-normal"</span>,
<span class="va">listAFTsSim_n500_p1000</span> <span class="op">&lt;-</span> <span class="fu"><a href="../reference/modelSim.html">modelSim</a></span><span class="op">(</span>model <span class="op">=</span> <span class="st">"AFTshift"</span>, matDistr <span class="op">=</span> <span class="st">"unif"</span>, matParam <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span><span class="op">(</span><span class="op">-</span><span class="fl">1</span>,<span class="fl">1</span><span class="op">)</span>, n <span class="op">=</span> <span class="fl">500</span>,
p <span class="op">=</span> <span class="fl">100</span>, pnonull <span class="op">=</span> <span class="fl">100</span>, betaDistr <span class="op">=</span> <span class="st">"unif"</span>, hazDistr <span class="op">=</span> <span class="st">"log-normal"</span>,
hazParams <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span><span class="op">(</span><span class="fl">0.2</span>, <span class="fl">7.8</span><span class="op">)</span>, seed <span class="op">=</span> <span class="fl">1</span>, d <span class="op">=</span> <span class="fl">0</span><span class="op">)</span>
<span class="co">#&gt; Warning in modelSim(model = "AFTshift", matDistr = "unif", matParam = c(0, :</span>
<span class="co">#&gt; Warning in modelSim(model = "AFTshift", matDistr = "unif", matParam = c(-1, :</span>
<span class="co">#&gt; Options "non-linearity with interactions" not available</span>
<span class="co">#&gt; Warning in log(mat_grille_ti * (1/as.vector(eta_i)) - matrix(phi2, nrow(Z), :</span>
<span class="co">#&gt; production de NaN</span>
<span class="fu"><a href="https://rdrr.io/r/graphics/hist.html">hist</a></span><span class="op">(</span><span class="va">listAFTsSim_n500_p1000</span><span class="op">)</span></code></pre></div>
<p><img src="How-to-simulate-survival-models_files/figure-html/sim_aft_mod_model-1.png" width="700"></p>
</div>
......@@ -870,7 +888,7 @@ where <span class="math inline">\(\Phi(t)\)</span> is the distribution function
<p>Chen, Ying Qing, and Mei-Cheng Wang. 2000. “Analysis of Accelerated Hazards Models.” <em>Journal of the American Statistical Association</em> 95 (450): 608–18. doi:<a href="https://doi.org/10.1080/01621459.2000.10474236">10.1080/01621459.2000.10474236</a>.</p>
</div>
<div id="ref-http://zotero-org/users/local/uYsfYM7W/items/NN8SEC4E">
<p>Cox, D. R. 1972. “Regression Models and Life-Tables.” <em>Journal of the Royal Statistical Society. Series B (Methodological)</em> 34 (2): 187–220. <a href="http://www.jstor.org/stable/2985181" class="uri">http://www.jstor.org/stable/2985181</a>.</p>
<p>Cox, D. R. 1972. “Regression Models and Life-Tables.” <em>Journal of the Royal Statistical Society. Series B (Methodological)</em> 34 (2): 187–220.</p>
</div>
<div id="ref-http://zotero-org/users/local/uYsfYM7W/items/KCILGW99">
<p>Leemis, Lawrence M., Li-Hsing Shih, and Kurt Reynertson. 1990. “Variate Generation for Accelerated Life and Proportional Hazards Models with Time Dependent Covariates.” <em>Statistics &amp; Probability Letters</em> 10 (4): 335–39. doi:<a href="https://doi.org/10.1016/0167-7152(90)90052-9">10.1016/0167-7152(90)90052-9</a>.</p>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment