qPharmetra / qpToolkit

Tools for population PK modeling, visualization, and reporting
Other
1 stars 1 forks source link

expand nr of grouping levels nm.process.coveffects() #2

Closed nhprins closed 4 years ago

nhprins commented 5 years ago

currently supports up to 3 grouping levels (3 covariates per parameter) but the number of options for assigning them as categorical covariates is limited. Example: in the following equation:

eqs=make.eqs( CL = exp(THETA1 + (HEPAT=="Moderate") * THETA14 + (HEPAT=="Severe")*THETA15 + ETA1) , V1 = exp(THETA2 + (ASIAN==1)*THETA16 + (SEX==1)*THETA21 + ETA2)*(WT/70)^exp(THETA22) , MTT = exp(THETA7 + (FORM==4)*(THETA10)+ (FORM==6)*(THETA11)+(MYFOOD==1)*(THETA8)+ETA3) )

I managed to get permutations of the covariate effects for MTT (2 categorical) and CL (1 categorical) while for V1 (2 categorical and 1 continuous) I only got it to run if I dropped either ASIAN or SEX as a categorical by assigning it to be continuous. So I got stuff out of the tool but somewhere in the stratification inside nm.process.coveffects() call it threw an error about attributes and names of a covariate not matching.

bergsmat commented 4 years ago

I changed sapply to lapply @247. sapply @243 does not seem to be a problem. I added block 'test' in runNONMEMAnalysis.Rmd to show that this works (eval = false, must be executed manually, nonsense example).