Hi,
I’m working with data which are characterised by :
- log-linear accross time : log(Y)=a+b*Day
- Repeated measurements
- Possibility of complete regression i.e. subjects with regressive tumor volume
- Variability inter and intra groups
Here is a example of what the data could look like :
Here is the code :
nlprior <- c(prior(normal(0, 100),nlpar = "alpha"),
prior(normal(0, 100),nlpar = "beta"),
prior(gamma(0.01, 0.01), class=sd, nlpar = "alpha"),
prior(gamma(0.01, 0.01), class=sd, nlpar = "beta"),
prior(gamma(0.01, 0.01), class=sigma)
)
nlform <- bf(log_value ~ alpha+beta*(day),
alpha ~(1|gr(Animal_ID, by=Group_no))+Group_no,
beta ~ (1|gr(AnimaI_ID, by=Group_no))+Group_no,
nl = TRUE)
fit <- brm(formula = nlform,
data = data,
prior=nlprior,
sample_prior = "yes",
family = gaussian(),
chains = 4,
save_pars=save_pars(all=TRUE),
cores= parallel::detectCores(),
iter = 100000,
thin = 5,
warmup=25000,
seed = 42,
control = list(adapt_delta = 0.95, max_treedepth = 15)
)
Here are my issues :
- Is it possible to only put the gr(Animal_ID, by=Group_no) on beta and not alpha ? it’s not running if I only put on beta.
- The code made several hours (even days) to compute, is it a way to improve that ?
- I used hypothesis function to compare each group to the first one. Is it necessary to adjust for multiplicity just like in frequentist. If yes, how ? If no, why ?
I can’t provide the data but I hope it’s clear.
Thanks a lot