Baseline parameter bimodal distribution

Hello everyone,

I have a baseline parameter from a PD model which follows a bimodal distribution depending on wether the patient has one type of tumor or the other.

I wrote the code like this:

sequence{T=BASE}

covariate(Type())

stparm(BASE = (tvBASE1*(Type==1)+tvBASE2*(Type==0))*exp(nBASE))

fixef(tvBASE1 = c(0,10,))
fixef(tvBASE2 = c(0,50,))

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?

Best,

Joao

If it helps: I get a Return Code of 0.

Thanks,

Joao

Dear Joa

Can you try the following code

define separately base1 and base 2 as structural parameter

stparm(base1=tvbase1*exp(nbase1))

stparm(base2=tvbase2*exp(nbase2))

fixef(tvbase1=c(0,10,))

fixef(tvbase2=c(0,50,))

ranef(diag(nbase1,nbase2)=c(1,1,1))

then now you define base

fcovariate(type())

base=(type==0?base1:base2)

sequence{T=base}

Best would be to get the project. Then I can debug.

best

Serge

Hi Serge,

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?

Thanks,

Joao

Hi serge,

The model works and the engine converges. So, thanks a lot for your help.

Do you have an idea why I have to use two etas, like you suggested:

stparm(base1=tvbase1*exp(nbase1))

stparm(base2=tvbase2*exp(nbase2))

and it does not work if I use just one eta?

stparm(base1=tvbase1*exp(nbase))

stparm(base2=tvbase2*exp(nbase))

This is bothering me a little.

Best,

Joao

Dear Joao

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.

Best Regards

Serge

Hi Serge,

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…

Best,

Joao

what engines are you using ? for QRPEM you need to make sure that we have a valid separation between the mean and variance (Mu modeling)

I am using QRPEM. What do you mean by that? Do you mean that I have to a have a different random effect for each population value?