title: Simulate survival data from a Weibull distribution with both right and interval censoring
body: <p>I'm working with the following Weibull distribution:</p>
  <pre><code>df&lt;-data.frame(y=rweibull(1000,shape=1.4,scale=70))
  </code></pre>
  <p>Now, I would like to create a dataset with both right censoring and interval censoring.</p>
  <p>To add right censoring I selected a threshold of 150 and added a censoring column called &quot;cens&quot;:</p>
  <pre><code>df &lt;- df %&gt;% mutate(cens=if_else(y&gt;150,1,0))
  </code></pre>
  <p>Now, I would like to add interval censoring to the data, but I don't know how to proceed.</p>
  <p>At first, I thought about adding and subtracting a random value to each <code>y</code> value:</p>
  <pre><code>y_upper = y + 5
  y_lower = y - 5
  </code></pre>
  <p>but realized that when <code>y&lt;5</code> this causes <code>y_lower = 0</code> or <code>y_lower&lt;0</code></p>
  <p>Another alternative would be to remove all <code>y&lt;5</code> values, but I don't want to truncate the dataset, because I want to use it to test a model.</p>