I want to carry out a sample size calculation by simulation for interval-censored data using the R package icenReg .
In my study, participants known to have contracted an infection will be tested at roughly weekly intervals for six weeks for antibodies to the infectious agent. The primary objective is to determine how long after the infection antibodies remain detectable in the body. The secondary objective is to investigate how the variables age, bodyweight and epidemiological status (epi_status) affect how long the antibodies remain detectable.
Participants’ epi_status can either be:
• Endemic: the infectious agent has been consistently present in the participant’s location for a long period of time prior to the start of the study
• Epidemic: the infectious agent was recently introduced to the location shortly before the start of the study.
See example data below:
id location age_category bodyweight epi_status lower upper
1 A 1 69.4 epidemic 7 27
2 B 2 67.7 endemic 20 28
3 B 3 83.9 endemic 8 14
4 C 1 86.2 endemic 31 39
5 A 1 67.5 epidemic 21 NA
6 B 3 74.4 endemic 4 17
7 C 2 80.5 endemic 17 25
8 A 2 70.5 epidemic 0 15
9 C 1 65.2 endemic 4 20
10 A 4+ 73.9 epidemic 15 NA
I’ve completed the calculation following the example in the simIC_weib help file:
test_data <- simIC_weib(
n = 100,
b1 = 0.5,
b2 = -0.5,
model = "ph",
shape = my_shape,
scale = my_scale,
inspections = 6,
inspectLength = 7)
model <- ic_sp(Surv(l, u, type = 'interval2') ~
x1 + x2,
data = test_data,
bs_samples = 100)
The shape and scale are informed by some field data which I’m using as a basis for the calculation. The variable x1 is normally distributed and x2 is Bernoulli, as per the simIC_weib help file.
However, I’d like to see if I can make the model a closer fit to my desired model, which is:
model <- ic_sp(Surv(l, u, type = 'interval2') ~
frailty(location) +
age_category + bodyweight + epi_status,
data = test_data,
bs_samples = 100)
My questions are:
- Is it possible to add a frailty term to the model, and how would I do this (my participants are clustered by location)?
- Is it possible to add an additional fixed effect with Poisson distribution to the model (e.g. my age_category variable), and how?
- Is it possible to change the probability of the Bernoulli variable x2 in the model, and how (for my Bernoulli variable epi_status there are more endemic participants than epidemic participants)?
I’d also like to clarify a couple of things about the arguments in the simIC_weib function.
inspections – in my case does this equate to the number of times the participants are tested?
inspectLength – is this the total observation period or the interval between samplings?