Then, on my table, I map the covariate “Type” to a column of either 1 or 0. What I want to achieve is, if Tumor is Type==1, then baseline is tvBASE1, if tumor is Type==0, then baseline is tvBASE2. It does not seem to work. Do you have a suggestion about how I should code this?
Separating BASE1 and BASE2 with different random effects seems to be the trick. If I use the same random effect (nBASE) for both parameters, the engine does not run. However I had to adapt the bottom part of your code:
fcovariate(type())
test=(type==1)
BASE=(test==0?BASE1:BASE2)
sequence{T=BASE}
The Engine is running, I’ll let you know if it converges - It takes a while because the model is complicated.
I found out that this also works:
sequence{T=BASE1*(type==1)+BASE2*(type==0)}
Do you see an advantage of using the first approach, or the second approach?
If you put 2 random effects , you have more degree of freedom with respect to the each in the optimal eta for each patient. I guess it is related to what is happening with only one random effect.
I would need the project to dig more but the bottom line is that it is working, then all is good.
it is working. The problem that I see, is that I am generating random effects for both BASE1 and BASE2 for all patients. This is not 100% correct, because patients either have BASE1, or BASE2, not both.
Is it possible to model this as a binomial distribution in NLME?
I could use the non-parametric modelling approach, however, I still want to keep the normally distributed etas for the other parameters…