Description Usage Arguments Details Examples

View source: R/simulationFunctions.R

Simulates current status data from a survival regression model with a Weibull baseline distribution.

1 2 | ```
simCS_weib(n = 100, b1 = 0.5, b2 = -0.5, model = "ph", shape = 2,
scale = 2)
``` |

`n` |
Number of observations |

`b1` |
Regression coefficient 1 |

`b2` |
Regression coefficient 2 |

`model` |
Regression model to use. Choices are |

`shape` |
Baseline shape parameter |

`scale` |
Baseline scale parameter |

Exact event times are simulated according to the given survival regression model.
Two covariates are used; `x1 = rnorm(n), x2 = 1 - 2 * rbinom(n, 1, .5)`

. After
event times are simulated, current status inspection times are simulated following the
exact same conditional distribution as event time (so each event time necessarily has
probability 0.5 of being right censored).

Returns data in current status format, i.e. inspection time and event indicator.
Use `cs2ic`

to convert to interval censored format (see example).

1 2 | ```
simData <- simCS_weib()
fit <- ic_par(cs2ic(time, event) ~ x1 + x2, data = simData)
``` |

icenReg documentation built on Oct. 16, 2018, 1:04 a.m.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.