Function for simulating survival data.
simsurvdata(n = 100, trt = 2, age = 2, sex = 1.5, cens = 0.3)
(integer(1))
Number of samples
(numeric(1))
Coefficients for covariates.
(numeric(1))
Proportion of censoring to be generated, cut-off time is then
selected as the quantile that results in cens
.
Currently limited to three covariates, Weibull survival times, and Type I censoring. This will be expanded to a flexible simulation function in future updates. For now the function is primarily limited to helping function examples.
simsurvdata()
#> sexF age trt time status
#> 1 1 48 0 4.972 1
#> 2 1 37 1 6.869 0
#> 3 1 38 1 6.869 0
#> 4 1 26 0 4.639 1
#> 5 1 36 1 6.869 0
#> 6 0 25 1 5.433 1
#> 7 0 34 0 3.463 1
#> 8 1 30 1 6.708 1
#> 9 1 23 0 4.993 1
#> 10 0 26 0 3.515 1
#> 11 0 42 1 5.558 1
#> 12 0 32 0 3.507 1
#> 13 0 32 1 5.391 1
#> 14 0 34 1 5.566 1
#> 15 0 33 0 3.444 1
#> 16 1 24 1 6.524 1
#> 17 0 45 1 5.529 1
#> 18 0 38 1 5.558 1
#> 19 1 44 1 6.869 0
#> 20 0 43 1 5.394 1
#> 21 1 48 1 6.869 0
#> 22 0 46 1 5.483 1
#> 23 0 30 1 5.501 1
#> 24 1 28 0 5.022 1
#> 25 1 42 1 6.869 0
#> 26 1 42 1 6.867 1
#> 27 0 48 1 5.549 1
#> 28 0 44 1 5.298 1
#> 29 0 24 1 5.566 1
#> 30 0 29 1 5.586 1
#> 31 1 26 0 4.821 1
#> 32 0 44 0 3.483 1
#> 33 0 24 1 5.402 1
#> 34 1 24 1 6.869 0
#> 35 1 22 1 6.824 1
#> 36 1 22 1 6.869 0
#> 37 0 36 0 3.341 1
#> 38 1 23 1 6.655 1
#> 39 1 42 1 6.869 0
#> 40 1 42 1 6.869 0
#> 41 1 47 1 6.869 0
#> 42 0 36 1 5.469 1
#> 43 0 46 1 5.454 1
#> 44 0 33 1 5.488 1
#> 45 1 25 0 4.799 1
#> 46 1 33 0 5.061 1
#> 47 1 49 1 6.726 1
#> 48 1 35 1 6.869 0
#> 49 1 28 1 6.869 0
#> 50 0 28 1 5.495 1
#> 51 1 36 1 6.869 0
#> 52 1 39 0 4.961 1
#> 53 1 30 1 6.869 0
#> 54 0 22 1 5.362 1
#> 55 1 34 1 6.869 0
#> 56 1 45 0 5.035 1
#> 57 0 37 1 5.522 1
#> 58 0 31 1 5.379 1
#> 59 1 36 0 4.989 1
#> 60 1 47 0 5.055 1
#> 61 0 35 1 5.561 1
#> 62 0 25 1 5.465 1
#> 63 1 36 1 6.635 1
#> 64 1 49 1 6.869 0
#> 65 1 29 1 6.869 0
#> 66 0 45 0 3.538 1
#> 67 1 29 1 6.869 0
#> 68 1 26 0 5.007 1
#> 69 0 21 0 3.418 1
#> 70 1 27 0 4.962 1
#> 71 1 31 0 4.967 1
#> 72 1 25 1 6.869 0
#> 73 1 29 1 6.869 0
#> 74 1 21 1 6.869 0
#> 75 1 50 1 6.819 1
#> 76 1 44 1 6.869 0
#> 77 1 23 1 6.869 0
#> 78 0 46 1 5.524 1
#> 79 1 37 0 5.057 1
#> 80 1 33 1 6.869 0
#> 81 0 22 1 5.396 1
#> 82 0 37 1 5.317 1
#> 83 0 22 0 3.501 1
#> 84 1 26 1 6.755 1
#> 85 1 36 1 6.869 0
#> 86 1 34 1 6.869 0
#> 87 0 25 0 3.547 1
#> 88 1 24 1 6.778 1
#> 89 0 35 0 3.455 1
#> 90 0 48 0 3.537 1
#> 91 1 30 1 6.869 0
#> 92 0 26 1 5.492 1
#> 93 1 28 1 6.869 0
#> 94 0 36 1 5.434 1
#> 95 1 21 0 4.987 1
#> 96 1 44 1 6.869 0
#> 97 0 23 1 5.537 1
#> 98 0 36 0 3.455 1
#> 99 0 37 1 5.339 1
#> 100 1 39 1 6.841 1