Jump to content


Photo

Error when adding covariates


  • Please log in to reply
6 replies to this topic

#1 j.pereira

j.pereira

    Advanced Member

  • Members
  • PipPipPip
  • 38 posts

Posted 31 March 2016 - 07:53 AM

Dear All,

 

I have a PK-PD model which runs fine without covariates.

 

When I add covariates, the following error occurs:

 

Error in Population:
'".\NLME7.exe"' is not recognized as an internal or external command,
operable program or batch file.

Model execution failed or cancelled

 

My covariates are in the PD model and are categorical. They are there to explain the effect that a co-medication has on the activity of a tumor killing drug:

 

I define them like this:

 

covariate(DRUG1())#categorical covariates
covariate(DRUG2())

 

stparm(kill0 = tvkill0*exp(effectDRUG1(DRUG1==1))*exp(effectDRUG2(DRUG2==1))*exp(nkill0)) #DRUG1 and DRUG2 as covariates of kill rate

 

fixef(tvkill0 = c(0,0.0002,))

fixef(effectDRUG1= c(0,1,)) #increase of kill rate due to drug1
fixef(effectDRUG2 = c(0,1,)) #increase of kill rate due to drug2

 

Then, I map the covariates"DRUG1" to a column with 0 and 1 respectively, where 0 is no co-medication and 1 is co-medication. I do the same for "DRUG2". I looked in the manual and on this forum and I think I am doing it right, but it clearly seems that I am missing something...

 

Can someone give me a hint, of what I may be doing wrong?

 

Best,

Joao

 

 

 

 

 

 



#2 Simon Davis

Simon Davis

    Advanced Member

  • Administrators
  • 1,318 posts

Posted 31 March 2016 - 09:21 AM

Joao, I had something similar a few weeks back,  most likely you have a syntax error that is not being captured very elegantly.  If you cna't see any red text on the 'General' tab, please look at the Compiler Output for details and hopefully you can track it down from there.

 

Or you can post the whole code/project here for us to test, (use 'More Reply Options' to add an attachment).

 

 Simon.



#3 j.pereira

j.pereira

    Advanced Member

  • Members
  • PipPipPip
  • 38 posts

Posted 31 March 2016 - 09:58 AM

Hello Simon,

 

Thank you for point out the syntax error. I found the mistake.

 

stparm(kill0 = tvkill0*exp(effectDRUG1(DRUG1==1))*exp(effectDRUG2(DRUG2==1))*exp(nkill0)) #DRUG1

I forgot to add the  multplication *.

 

Normally code mistakes like this are captured in the "Warnings" box. That's why did not look for it in the beginning.

 

This is correct and works:

stparm(kill0 = tvkill0*exp(effectDRUG1*(DRUG1==1))*exp(effectDRUG2*(DRUG2==1))*exp(nkill0)) #DRUG1

 

 

 

When we are already at it...

 

My model seems to have problems converging with the Laplacian Engine. It works with QRPEM ;)

 

What do you recommend as number of iterations for the QRPEM engine? In the user guide (Page 229) says:

Usually 50 iterations are enough to reach convergence

 

However, when selecting the QRPEM engine, the standard NIter is 1000.

 

Joao



#4 Simon Davis

Simon Davis

    Advanced Member

  • Administrators
  • 1,318 posts

Posted 31 March 2016 - 10:38 AM

In answer to your comment about it not showing in the warnings, I had our development team test my code in the working build of next release candidate.  It still somehow evades the being trapped by red text/Warnings tab however the pop-up error box now also says to see the Compiler Output for details. and in there they saw;

 

log4.txt:

.\Work\Model.c:458:29: error: 'freeze' undeclared here (not in a function)

static double __tvKa_low  = freeze;

  

 

Which I hope would be sufficient to locate the error and trust that will help others in the future. In the mean time hopefully this tip will help in the current releases.

 

Regarding iterations - I'll leave that to one of the more expert modellers but remember this is a maximum, the software will stop earlier if it has converged on a solution.  So unles I had set it to something small, which on a pop model might be 50, and I saw a message about terminating at final iteration, I'd be tempted to either restart with last/better inital estimates.  And/or give more iterations to find a solution in, e.g increase 50 to 100.

 

 Simon



#5 serge guzy

serge guzy

    Advanced Member

  • Members
  • PipPipPip
  • 485 posts

Posted 31 March 2016 - 10:44 AM

In answer to your comment about it not showing in the warnings, I had our development team test my code in the working build of next release candidate.  It still somehow evades the being trapped by red text/Warnings tab however the pop-up error box now also says to see the Compiler Output for details. and in there they saw;

 

log4.txt:

.\Work\Model.c:458:29: error: 'freeze' undeclared here (not in a function)

static double __tvKa_low  = freeze;

  

 

Which I hope would be sufficient to locate the error and trust that will help others in the future. In the mean time hopefully this tip will help in the current releases.

 

Regarding iterations - I'll leave that to one of the more expert modellers but remember this is a maximum, the software will stop earlier if it has converged on a solution.  So unles I had set it to something small, which on a pop model might be 50, and I saw a message about terminating at final iteration, I'd be tempted to either restart with last/better inital estimates.  And/or give more iterations to find a solution in, e.g increase 50 to 100.

 

 Simon

* is missing before (DRUG1) and before (DRUG2)  . Unfortunately the pre-compiler does not catch it. However look at ouput and you will see that something there is not legal.

Best

Serge



#6 j.pereira

j.pereira

    Advanced Member

  • Members
  • PipPipPip
  • 38 posts

Posted 31 March 2016 - 11:16 AM

Thank you all for your comments. Very helpful.

 

Joao



#7 smouksassi1

smouksassi1

    Advanced Member

  • Members
  • PipPipPip
  • 231 posts
  • LocationMontreal

Posted 31 March 2016 - 05:57 PM

have a look at the convergence plots how stable are the -2LL and the parameter estimates ? there is no iteration value that is guaranteed to work for all problems 






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users