Jump to content


Photo

Baseline parameter bimodal distribution


  • Please log in to reply
8 replies to this topic

#1 j.pereira

j.pereira

    Advanced Member

  • Members
  • PipPipPip
  • 38 posts

Posted 19 April 2016 - 12:33 PM

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

 



#2 j.pereira

j.pereira

    Advanced Member

  • Members
  • PipPipPip
  • 38 posts

Posted 19 April 2016 - 12:57 PM

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

 

Thanks,

Joao



#3 serge guzy

serge guzy

    Advanced Member

  • Members
  • PipPipPip
  • 485 posts

Posted 19 April 2016 - 01:20 PM

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

 

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



#4 j.pereira

j.pereira

    Advanced Member

  • Members
  • PipPipPip
  • 38 posts

Posted 19 April 2016 - 01:31 PM

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



#5 j.pereira

j.pereira

    Advanced Member

  • Members
  • PipPipPip
  • 38 posts

Posted 19 April 2016 - 03:20 PM

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



#6 serge guzy

serge guzy

    Advanced Member

  • Members
  • PipPipPip
  • 485 posts

Posted 19 April 2016 - 05:02 PM

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



#7 j.pereira

j.pereira

    Advanced Member

  • Members
  • PipPipPip
  • 38 posts

Posted 20 April 2016 - 08:43 AM

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



#8 smouksassi1

smouksassi1

    Advanced Member

  • Members
  • PipPipPip
  • 231 posts
  • LocationMontreal

Posted 21 April 2016 - 03:04 PM

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)



#9 j.pereira

j.pereira

    Advanced Member

  • Members
  • PipPipPip
  • 38 posts

Posted 22 April 2016 - 07:20 AM

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?






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users