Description Usage Arguments Value Examples
Compute exhaustive statistics for the piecewise constant hazard model
1 | exhaustive_stat_2d(surv_data, cuts_age, cuts_cohort)
|
surv_data |
data frame containing individuals' age, cohort, and delta |
cuts_age |
Cuts defining the age intervals |
cuts_cohort |
Cuts defining the cohort intervals |
A list containing O, the observed events in each interval, and R, the time at risk in each age-cohort rectangle
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | mu <- log(1e-2)
age_seq <- seq(0, 100, length.out = 100)
cohort_seq <- seq(1900, 1900 + age_seq[101], length.out = age_length + 1)
age_coef <- seq(0, 2, length.out = age_length - 1)
cohort_coef <- seq(0, 0.8, length.out = age_length - 1)
islet_ls = list(list(mean = c(1945, 45), sigma = 100 * diag(2), coef = 40))
hazard <- map_maker(mu, age_coef, cohort_coef, age_seq, cohort_seq, islet_ls = islet_ls)
set.seed(0)
sample_size <- 1000
censoring <- runif(sample_size, 75, 100)
surv_data <- map_surv(hazard, sample_size = sample_size,
dob_dist = "unif", dob_dist_par = c(1900, 2000)) %>%
mutate(delta = as.numeric(censoring >= age)) %>%
mutate(age = pmin(age, censoring))
surv_data
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.