Bioequivalence and Bioavailability Forum

Main page Policy/Terms of Use Abbreviations Latest Posts

 Log-in |  Register |  Search

Back to the forum  Query: 2017-09-21 23:18 CEST (UTC+2h)
 
PK_Lover
Junior

Portugal,
2014-11-21 00:28

Posting: # 13895
Views: 8,483
 

 Difficulties with NCA BEAR [R for BE/BA]

Hello all,

I am trying BEAR for the first time for a simple NCA and ANOVA analysis for a 2x2x2 BE study data.

I have arranged all the data in a .csv file with subj,seq,perd,time,conc and I have maintained T0=0 and all the other LLOQ (either at the start of the schedule or at the end) as NA.

I ran BEAR, import the file, the values appear correctly in the table. It starts the analysis, it shows some pk values but then states:

Error in lm.fit(x, y, offset = offset, singular.ok = singular.ok, ...) :
  NA/NaN/Inf in 'y'


and crashes. I have checked all the data, seems ok.

Could you please help me and tell me whats wrong?

Thank you!
yjlee168
Senior
Homepage
Kaohsiung, Taiwan,
2014-11-21 07:34
(edited by yjlee168 on 2014-11-21 11:05)

@ PK_Lover
Posting: # 13898
Views: 7,294
 

 Difficulties with NCA BEAR

Dear PK_Lover,

Could you post the setting content from R console here after running 'go()' at the beginning? Something like:

 -------------------  Current settings ------------------

                 Methods Setting                  which_is
1              run demo?       1                       yes
2          study design?       0           2x2x2 crossover
3  single-/multiple-dose       0               single-dose
4      lambda_z estimate       0          adj. R sq. (ARS)
5        trapezoidal AUC       0        linear-up/log-down
6      BE criterion (LL)      80               lower limit
7                   ODA?       0                        no
8                  dose?  100000                dose given
9        dosing interval      24       *multiple-dose only
10                 Tlast     120       *multiple-dose only
11                 pAUC?       0                   all AUC
12            pAUC_start     121 the starting time of pAUC
13              pAUC_end     128      the end time of pAUC
14           IDP output?       0                        no

 The plot label of x-axis -> Time after Dosing (hr)
  and the label of y-axis -> DrugX Plasma Conc. (ng/mL)
 --------------------------------------------------------
...

Is your analysis using the partial or truncated AUC (pAUC) with multiple-dosed? If yes, please make sure that pAUC_start and pAUC_end should count from the time of starting dose (i.e., time = 0.), not within one dosing interval. If not, please turn pAUC off (= 0). Sorry about this error.

» [...]» I ran BEAR, import the file, the values appear correctly in the table. It starts the analysis, it shows some pk values but then states:
»
» Error in lm.fit(x, y, offset = offset, singular.ok = singular.ok, ...) :
» NA/NaN/Inf in 'y'
»

» and crashes. I have checked all the data, seems ok.
» [...]

All the best,
---Yung-jin Lee
[image]bear v2.8.3:- created by Hsin-ya Lee & Yung-jin Lee
Kaohsiung, Taiwan http://pkpd.kmu.edu.tw/bear
Download link (updated) -> here
PK_Lover
Junior

Portugal,
2014-11-22 00:07

@ yjlee168
Posting: # 13911
Views: 7,169
 

 Difficulties with NCA BEAR

Dear yjlee168,

thank you very much for your quick reply (I am honored!).

I am sorry for not replying earlier but I did not have access to the station where I have R installed until now.

Here is the setup (it is the default):

Methods Setting which_is
1 run demo? 0 no
2 study design? 0 2x2x2 crossover
3 single-/multiple-dose 0 single-dose
4 lambda_z estimate 0 adj. R sq. (ARS)
5 trapezoidal AUC 0 linear-up/log-down
6 BE criterion (LL) 80 lower limit
7 ODA? 0 no
8 dose? 100000 dose given
9 dosing interval 24 *multiple-dose only
10 Tlast 120 *multiple-dose only
11 pAUC? 0 all AUC
12 pAUC_start 121 the starting time of pAUC
13 pAUC_end 128 the end time of pAUC
14 IDP output? 0 no

The plot label of x-axis -> Time after Dosing (hr)
and the label of y-axis -> DrugX Plasma Conc. (ng/mL)


And I am using data from a simple Crossover design with 2 periods, single administration.
yjlee168
Senior
Homepage
Kaohsiung, Taiwan,
2014-11-22 03:21

@ PK_Lover
Posting: # 13912
Views: 7,135
 

 Difficulties with NCA BEAR

Dear PK_Lover,

Do you use the default setting to analyze your data? I think the error is due to failure to find a lambda_z during NCA (invalid 'y' when doing linear regression). If the error still persists, please check your data carefully. Or try to switch lambda_z estimation method to 'Select 2-6 data points manually' (lambda_z estimation = 5) instead of using the default of 'Adjusted R sq. (ARS).' By the way, manual data point selection may also provide you a chance to check subjects' data individually. Hope this can help.

» [...]
» And I am using data from a simple Crossover design with 2 periods, single administration.

All the best,
---Yung-jin Lee
[image]bear v2.8.3:- created by Hsin-ya Lee & Yung-jin Lee
Kaohsiung, Taiwan http://pkpd.kmu.edu.tw/bear
Download link (updated) -> here
PK_Lover
Junior

Portugal,
2014-11-22 09:47
(edited by PK_Lover on 2014-11-22 11:18)

@ yjlee168
Posting: # 13913
Views: 7,117
 

 Difficulties with NCA BEAR

Dear yjlee168,

Yes, I think that is a possibility since I have some LLOQ points for the last collections.

I will try it manually and then will let the forum know if it worked ok.

Thank you very much!

EDIT: It worked like a charm! NCA and ANOVA done! Thanks a lot! I should change my nickname to BEAR_Lover! :)
yjlee168
Senior
Homepage
Kaohsiung, Taiwan,
2014-12-01 08:13

@ PK_Lover
Posting: # 13959
Views: 6,876
 

 help test NCA BEAR

Dear PK_Lover,

Great to hear that everything was going fine. Since I like to alert users about the error as you had, I have bear v2.6.4 (pre-release) ready to release. Unfortunately, I cannot reproduce the data set to test it. Could you please help (only when you are available; no rush at all) me to test bear? If you can, please download bear v2.6.4 from my wuala cloud storage here (bear_2.6.4.zip). Then set lambda_z estimation as ARS (or TTTARS, TTT, AIC, TTTAIC?) with your data set. See install.txt if you need to know how to install it. It is not a beforehand check-up for all subject's data points first, but will show a warning message before the crash message when dealing with invalid 'y'. Thanks in advanced.

» ... EDIT: It worked like a charm! NCA and ANOVA done! Thanks a lot! I should change my nickname to BEAR_Lover! :)

All the best,
---Yung-jin Lee
[image]bear v2.8.3:- created by Hsin-ya Lee & Yung-jin Lee
Kaohsiung, Taiwan http://pkpd.kmu.edu.tw/bear
Download link (updated) -> here
Emrah Soner Özdeş
Junior

Turkey,
2015-01-15 14:37

@ yjlee168
Posting: # 14293
Views: 6,425
 

 help test NCA BEAR

Dear yjlee168;

First of all I need to say that I am grateful for you guys for developing such a useful tool for BE/BA studies.

Currently I have the latest version of both R and the BEAR package. I am having the same issue mentioned in the first messaga of the thread.

It runs smooth until the 16th subject and stops in the 17th subjects, probably because of a BLOQ value in subject 17.

The workaround of manual selection of points worked fine with me. But as you guess it is not very practical and time consuming. I used to use WNL for NCA analysis, and have the feeling of the method of WNL for Lambdaz calculation (Rsq adjusted) is the most reliable one (I never tried the other methods).

So is there any other solution to this problem other than manuel selection ?


I found the solution before your reply.

I just replaced BLOQ values at the end with "NA" and it worked like a magic.

Got the hint from: http://pkpd.kmu.edu.tw/bear/

Best Regards

Emrah Soner Özdeş


Edit: Merged with a follow-up post. You can edit your original post for 24 hours. [Helmut]
Jam
Junior

UK,
2015-01-23 08:55
(edited by Ohlbe on 2015-01-23 10:04)

@ Emrah Soner Özdeş
Posting: # 14314
Views: 6,264
 

 help test NCA BEAR

I get the same problem when profiles have zero values towards the end of the profile. Also, I found my version of Excel (2013) produces CSV files with a comma at the end of each line. This seems to cause Bear to misread the CSV files.
Nevertheless I very much appreciate having the package.

Jam


Edit: Full quote removed. Please delete everything from the text of the original poster which is not necessary in understanding your answer; see also this post! [Ohlbe]
yjlee168
Senior
Homepage
Kaohsiung, Taiwan,
2015-01-25 04:35

@ Jam
Posting: # 14319
Views: 6,239
 

 CSV files with a comma at the end of each line?

Dear Jam,

Thanks for using bear and your interesting messages. But I don't quite understand why is 'CSV files with a comma at the end of each line.' Is it normal for MS-Excel 2013 to produce a csv that way? Or did you have extra settings to save/export that kind of csv from Excel 2013? It sounds like that Excel is treated your dataset as if there is still data after the end of each row.

All the best,
---Yung-jin Lee
[image]bear v2.8.3:- created by Hsin-ya Lee & Yung-jin Lee
Kaohsiung, Taiwan http://pkpd.kmu.edu.tw/bear
Download link (updated) -> here
xtianbadillo
Junior

Mexico,
2016-09-15 22:44

@ yjlee168
Posting: # 16646
Views: 3,753
 

 Difficulties with NCA BEAR

Dear yjlee168

I had the same problem, thanks to your contribution, I changed the default settings as you said and the issue was solved.

» Do you use the default setting to analyze your data? I think the error is due to failure to find a lambda_z during NCA (invalid 'y' when doing linear regression). If the error still persists, please check your data carefully. Or try to switch lambda_z estimation method to 'Select 2-6 data points manually' (lambda_z estimation = 5) instead of using the default of 'Adjusted R sq. (ARS).' By the way, manual data point selection may also provide you a chance to check subjects' data individually. Hope this can help.


Edit: Full quote removed. Please delete everything from the text of the original poster which is not necessary in understanding your answer; see also this post #5! [Helmut]
yjlee168
Senior
Homepage
Kaohsiung, Taiwan,
2016-09-16 09:42
(edited by yjlee168 on 2016-09-16 18:00)

@ xtianbadillo
Posting: # 16647
Views: 3,715
 

 old bear and friends

Dear xtianbadillo,

I wonder that you are using the previous version of bear. I have already fixed the error since v2.7.1. Now it's v2.7.7.

The error comes from that the data point selection method (such as ARS) fails to select at least three data points after Cmax to estimate λz. Thus, there is no drug plasma conc. (i.e., 'y') selected at all. That's what the error messages tell us. In other words, you may have at least one subject who had insufficient data points (≧ 3 data points after Cmax) to estimate λz. May I know what version of bear you used? You can upgrade bear from Sourceforge if you like (not on CRAN any more; very sorry about that). And try it again with the same dataset using ARS or others. It will tell you which subjects get involved with insufficient data points.

Hope this can help.

» ...I changed the default settings as you said and the issue was solved.

All the best,
---Yung-jin Lee
[image]bear v2.8.3:- created by Hsin-ya Lee & Yung-jin Lee
Kaohsiung, Taiwan http://pkpd.kmu.edu.tw/bear
Download link (updated) -> here
VStus
Regular

Poland,
2016-09-26 13:30

@ yjlee168
Posting: # 16684
Views: 3,369
 

 old bear and friends

Dear yjlee168,

» The error comes from that the data point selection method (such as ARS)

In 2.7.7 I've got an error trying to process a dataset from multiple-dose trial, regardless of the fact that I've selected 'multiple dose' in config. Is there a way to turn-off assessment of elimination parameters for multiple dose trials?

I wanted to recalculate AUCtau and confirm Cmax and Cmin values after switching to originally obtained concentrations.

'R.split[[j]]':index outside of borders
yjlee168
Senior
Homepage
Kaohsiung, Taiwan,
2016-09-26 18:04

@ VStus
Posting: # 16685
Views: 3,342
 

 multiple-dosed study with bear

Dear VStus,

The error sounds like that bear import null data points to analyze. Do you set proper values for both the dosing interval and Tlast (the time of the last dose given counted from time zero) with a multiple-dosed study (check with the cheat-sheet for bear setup)? If you worry about the data points for λz, you can switch to manual selection. However, the function of estimating λz cannot be turned off. Hope this can help. Good luck.

» ...
» 'R.split[[j]]':index outside of borders

All the best,
---Yung-jin Lee
[image]bear v2.8.3:- created by Hsin-ya Lee & Yung-jin Lee
Kaohsiung, Taiwan http://pkpd.kmu.edu.tw/bear
Download link (updated) -> here
VStus
Regular

Poland,
2016-10-11 09:01
(edited by VStus on 2016-10-11 10:28)

@ yjlee168
Posting: # 16715
Views: 3,137
 

 multiple-dosed study with bear

Dear Yung-jin Lee,

I'm finally back to the topic of multiple dose studies in bear. I've switched locale of error messages to English, so there will be no translation errors.

So yes, with the config I assume to be correct for multiple-dose study and standard Lambda_z assessment:
 -----------------  Current settings ----------------

                Methods                                     Setting
                 ------                                      ------
          study design?                             2x2x2 crossover
            dosing type                               multiple dose
     <U+03BB>z estimate                            adj. R sq. (ARS)
        trapezoidal AUC                          linear-up/log-down
   BE criterion (LL, %)                                          80
             dose (mg)?                                          10
                 ------                                      ------
        dosing interval                                          24
                  Tlast                                         168
                 ------                                      ------
 drug plasma conc. unit                                       ng/mL


I'm getting the same error:
Warning: Next to save all linear regression plots for λz estimation.
 It may take a while to finish. Press Enter to proceed...
Error in R.split[[j]] : subscript out of bounds


So, I change setup to select points manually and stuck with another issue: blank graph.
[image]

And, finally, error and halt of bear when I select stop for the graph:
****************************************************************************
 Data for the Ref. Products:                                               
----------------------------------------------------------------------------
 Cmax_ss, Tmax_ss, AUC(tau)ss, ln(Cmax_ss), ln(AUC(tau)ss), T1/2(z), 
  Vd/F, MRT, λz, Cl/F, Cav and Fluctuations will be calculated.
                                                                           
****************************************************************************
Waiting to confirm page change...
Error in setNames(data.frame(data), value.name) :
  'names' attribute [1] must be the same length as the vector [0]


It worked for me somehow previously (maybe previous version of bear?). Maybe I'll dig into the code to just avoid estimation of elimination parameters for multiple dose studies?

Thank you very much in advance!
I use bear from time to time for my work and it's very helpful!

Regards, VStus
yjlee168
Senior
Homepage
Kaohsiung, Taiwan,
2016-10-11 10:15

@ VStus
Posting: # 16718
Views: 3,091
 

 multiple-dosed study with bear

Dear Vstus,

I just run the demo of multiple-dose with bear. It is ok. Please make sure that your Tlast is set correctly (the dosing interval looks fine). For example, the following case has Tlast = 120 and dosing interval = 24.

 Time      conc.
  0.0       0.00
 72.0     283.80
 96.0     319.33
120.0     298.06
120.5     634.75
121.0     792.06
121.5     825.69
122.0     900.31
122.5    1083.75
123.0    1273.44
124.0    1475.38
126.0    1981.88
128.0    1669.88
130.0    1324.44
132.0    1052.69
144.0     245.91


BTW, in your setting why dose (mg)?      dose? The dose should be numeric in the unit of mg.

All the best,
---Yung-jin Lee
[image]bear v2.8.3:- created by Hsin-ya Lee & Yung-jin Lee
Kaohsiung, Taiwan http://pkpd.kmu.edu.tw/bear
Download link (updated) -> here
VStus
Regular

Poland,
2016-10-11 10:37

@ yjlee168
Posting: # 16720
Views: 2,994
 

 multiple-dosed study with bear

Dear Yung-jin Lee,

» Please make sure that your Tlast is set correctly (the dosing interval looks fine). For example, the following case has Tlast = 120 and dosing interval = 24.

My dataset includes only concentrations obtained during last (7th) day of treatment period. Last tablet was given on 7th day (that's why I've entered 168 hrs). Sampling is 24 hrs (for dosing period-only). Change of Tlast to 120 not helps.

My understanding is that I should add pre-steady state samples. Correct?

» BTW, in your setting why dose (mg)?      dose?

I've removed it intentionally from post to avoid breaking NDA :)

Regards, VStus
VStus
Regular

Poland,
2016-10-12 10:37

@ yjlee168
Posting: # 16726
Views: 3,112
 

 multiple-dosed study with bear

Dear Yung-jin Lee,

Thank you very much for your help!
It appeared that my dataset was buggy. After corrections and manual selection of timepoints for elimination it finally worked.

Regards,
VStus
yjlee168
Senior
Homepage
Kaohsiung, Taiwan,
2016-10-12 18:42

@ VStus
Posting: # 16727
Views: 2,926
 

 multiple-dosed study with bear [solved]

Dear VStus,

Great and very happy to know that the problem has been solved. Have a a nice day.

All the best,
---Yung-jin Lee
[image]bear v2.8.3:- created by Hsin-ya Lee & Yung-jin Lee
Kaohsiung, Taiwan http://pkpd.kmu.edu.tw/bear
Download link (updated) -> here
Back to the forum Activity
 Thread view
Bioequivalence and Bioavailability Forum | Admin contact
17,319 Posts in 3,704 Threads, 1,069 registered users;
27 users online (0 registered, 27 guests).

The statistician has no magic touch by which
he may come in at the stage of tabulation
and make something of nothing.    W. Edwards Deming

The BIOEQUIVALENCE / BIOAVAILABILITY FORUM is hosted by
BEBAC Ing. Helmut Schütz
XHTML/CSS RSS Feed