Helmut ★★★ ![]() ![]() Vienna, Austria, 2015-04-20 19:34 (3624 d 01:45 ago) Posting: # 14718 Views: 26,829 |
|
Dear all, I closed this thread. Let’s continue over here. I would say that nowadays few people perform a replicated study without having reference-scaling in mind. What would we need in bear?
PS: @ElMaestro. Remember that one of the referees of our reference dataset-MS wanted to discuss the statistical model and we refused? Until somebody shows that what regulators want right now is crap (which will happen – at least partly) we should get the same results independent from the software used. I would be happy if a noncommercial one is amongst them. — Dif-tor heh smusma 🖖🏼 Довге життя Україна! ![]() Helmut Schütz ![]() The quality of responses received is directly proportional to the quality of the question asked. 🚮 Science Quotes |
yjlee168 ★★★ ![]() ![]() Kaohsiung, Taiwan, 2015-04-20 21:36 (3623 d 23:43 ago) @ Helmut Posting: # 14719 Views: 24,229 |
|
Dear Helmut, ❝ What would we need in bear? Wow! thank you so much. But that's too much. It must be a typo. May I suggest as "what we can do with R?" There are lots of R users/gurus in this Forum. ❝ For the FDA that would be a mixed-effects model as given in the 2001 guidance and the progesterone guidance. I like this. ❝ For the EMA we would need an “all effects fixed” model (Method A of the Q&A). One stupid question ![]() ![]() ❝ • FDA – RSABE: Again the progesterone guidance. ❝ EMA – ABEL: The Q&A, Methods A & B. Crippled model to get CVwR... ❝ I would say, that’s the target. You should try to get funded from EMA or FDA for these projects. These are really great projects, indeed. — All the best, -- Yung-jin Lee bear v2.9.2:- created by Hsin-ya Lee & Yung-jin Lee Kaohsiung, Taiwan https://www.pkpd168.com/bear Download link (updated) -> here |
Helmut ★★★ ![]() ![]() Vienna, Austria, 2015-04-21 03:02 (3623 d 18:18 ago) @ yjlee168 Posting: # 14725 Views: 24,133 |
|
Hi Yung-jin, ❝ ❝ For the EMA we would need an “all effects fixed” model (Method A of the Q&A). ❝ if EMA needs an "all effects fixed" model, why do we use a mixed model to do analysis? Both the BE-GL and the Q&A state that all effect should be fixed. EMA generally accepts a mixed model, but may ask for recalculation in borderline cases (e.g., extreme imbalance, CI close to the AR). Sometimes assessors ask for recalculation even if the CI was very narrow and the PE was close to 1. Happened to me once. The Q&A specifically mentions SAS’ Proc GLM , not Proc Mixed .❝ I don't remember lme() right now,… In lme() it should be possible to specify all effects fixed. Actually the random effect(s) are optional. If is doesn’t work, lm() should do.❝ Does EMA imply that we should use lm() to analyze replicate crossover dataset? No. Both the FDA and the EMA do not mandate any software or routine within. Quote from the Q&A: SAS (version 9.1, SAS Institute Inc, NC) was used in the previous computations. Results obtained by alternative, validated statistical programs are also acceptable except spreadsheets because outputs of spreadsheets are not suitable for secondary assessment. ❝ You should try to get funded from EMA or FDA for these projects. These are really great projects, indeed. Gimme a break. I’m a lousy R-coder. Agencies want to get results from validated software. They don’t pay for its development. — Dif-tor heh smusma 🖖🏼 Довге життя Україна! ![]() Helmut Schütz ![]() The quality of responses received is directly proportional to the quality of the question asked. 🚮 Science Quotes |
yjlee168 ★★★ ![]() ![]() Kaohsiung, Taiwan, 2015-04-22 01:41 (3622 d 19:39 ago) @ Helmut Posting: # 14730 Views: 25,012 |
|
Dear Helmut, ❝ ... The Q&A specifically mentions SAS’ glm() works in R. ❝ In lme() does not work without random effect. Am I doing anything wrong? > require(nlme) If I compared lme(), lm(), and glm(), I got > mod.lme<-lme(log(Cmax) ~ seq + prd + drug, random=~drug -1|subj, data=TotalData, method="REML") ###lme in bear Summary of mod.lme Linear mixed-effects model fit by REML Summary of mod.lm Call: Summary of glm Call: — All the best, -- Yung-jin Lee bear v2.9.2:- created by Hsin-ya Lee & Yung-jin Lee Kaohsiung, Taiwan https://www.pkpd168.com/bear Download link (updated) -> here |
Astea ★★ Russia, 2016-11-04 01:13 (3060 d 19:06 ago) @ yjlee168 Posting: # 16771 Views: 20,858 |
|
Dear all! Trying to understand lm and lme I found a simple and very clear instruction (Lme tutorial). Hope it would be useful for someone not familiar with such models. I try to evaluate Data set I from QA in R. The model is as follows: > mod.lme<-lme(log(Cmax) ~ seq + prd + drug, random=~drug|subj/seq, data=QA) Then I try to interpret the data in order to estimate CI. I took 0.1465 as point estimation (exp(0,1465)=1,1578 and calculate CI as PE+- SE*t(0,1;219), where SE=0.04627. The result is 115,78: 107,26 - 124,97 (comparing with method B from QA might be 115,73: 107,17- 124,97). Not ideal but seems to be similar. What is the reason for difference: rounding or different model, or am I do something wrong? ![]() Later I try to recalculate it using bear and get > Fixed effects: log(Cmax) ~ seq + prd + drug And finally if I try to use lme just from yjlee168's (post#14730), < mod.lme<-lme(log(Cmax) ~ seq + prd + drug, random=~drug -1|subj, data=TotalData, method="REML") I got another result:
Fixed effects: log(Cmax) ~ seq + prd + drug However it seemed to me strange, what model is in bear now? And I still wonder how does the model affect the Point Estimation? For QA data set 1 I've got manually Tmean=7,830303 and Rmean=7,676036, T-R=0,1543 far from the estimated via lme PE. Trying to understand afermentioned Phoenix results I see non-integer df. How can they be achieved manually? — "Being in minority, even a minority of one, did not make you mad" |
mittyri ★★ Russia, 2016-11-05 18:38 (3059 d 01:41 ago) @ Astea Posting: # 16777 Views: 20,729 |
|
Dear Astea! so many questions ![]() I'll just put here my code as a solution. Yes, we cannot get SAS results, sorry... Please let me know if after investigation you still have some questions library(readxl) — Kind regards, Mittyri |
Astea ★★ Russia, 2016-11-05 20:27 (3058 d 23:53 ago) @ mittyri Posting: # 16778 Views: 20,600 |
|
mittyri!!! May I hug you?! This is what I actually wanted to get spending two nights in a desperate attempt to apply Alexandra Kuznetsova's lmerTest to BE! And the questions.. Still there are too many questions. Why didn't you provide the result of the code (that's the way of secret initiation?) First start with method B. My PE coincides fully with QA result (115.73), the CI calculated by your method slightly differs (107.26-124.88). But! What is that function - confint? May be something wrong with it? Cause if I use PE+-SE*t(0.1;219) where SE is 4.65e-02 I get 1,0717-1,2797 totally the target!!! Please explain how to get Std.Error and Value with more digits? I tried to add "digits=8" but nothing happened... Why does the model have (1|Subject) as random? I also tried (1|Subject/Sequence) and the result (PE and CI) remains the same. Can we use it instead? The other question is what from the output we can use to estimate R-variance in order to apply scABE? We are in front of the final step - from now we can make R tutorial to hold scABEL as did Helmut in WinNonLin, am I right? If it is so, Es ist fantastisch! ![]() — "Being in minority, even a minority of one, did not make you mad" |
mittyri ★★ Russia, 2016-11-05 21:01 (3058 d 23:18 ago) @ Astea Posting: # 16779 Views: 20,615 |
|
❝ mittyri!!! ❝ May I hug you?! ![]() ![]() ❝ Why didn't you provide the result of the code (that's the way of secret initiation?) I was so surprized by the results that was in hurry to share my code ![]() ❝ Please explain how to get Std.Error and Value with more digits? FormulationT<-summary(muddle.lmer)$coefficients["FormulationT",]
cat(round(exp(FormulationT[1]+FormulationT[2]*qt(0.05, FormulationT[3]))*100, 2), "-", confint is not the right thing here. Here we go: lmer treats Sequence, Period and Formulation as factors, Random is /~1|Subject/ (close to Method B), then [1] 0.1460882 PE is 115.73 SAS gives 115.73 what about LSMeans? PHX gives for Method B 7.67001367911898 and 7.81610190985527 and lmer gives Formulation Estimate what about CI? SAS gives 107.17-124.97 107.17 - 124.97 ❝ Why does the model have (1|Subject) as random? I also tried (1|Subject/Sequence) and the result (PE and CI) remains the same. Can we use it instead? Yes, we can. Subject in Sequence is SAS legacy. By the way as ElMaestro wrote, that's meaningless, because the reference grid (G-matrix) doesn't change. It will be useful only if we are enumerating the subjects in each sequence from 1 (Seq ABAB: 1, 2, 3...; Seq BABA: 1, 2, 3...) ❝ The other question is what from the output we can use to estimate R-variance in order to apply scABE? No, we cannot. Sorry, I must confess I don't have time now to implement this, but I would do it as follows: - exclude all T data first and then - build a linear model with lm() using only reference data. If nobody does it during the next week I'll try to code it by myself. ❝ We are in front of the final step - from now we can make R tutorial to hold scABEL as did Helmut in WinNonLin, am I right? If it is so, Es ist fantastisch! Ja, new feature to implement in BEAR, Yung-jin will be happy ![]() — Kind regards, Mittyri |
Astea ★★ Russia, 2016-11-06 12:50 (3058 d 07:30 ago) @ mittyri Posting: # 16781 Views: 20,659 |
|
❝ If nobody does it during the next week I'll try to code it by myself. Challenge accepted! Here is my rough code: library(readxl) gives PE is 115.73 as in Phoenix (see Helmut's RSABE tutorial). The code needs to be tested via another data... — "Being in minority, even a minority of one, did not make you mad" |
mittyri ★★ Russia, 2016-11-07 07:07 (3057 d 13:13 ago) @ Astea Posting: # 16782 Views: 20,785 |
|
Hi Astea, ❝ Here is my rough code: Nice work! ![]() Here's mine. I tried to prepare the dataframe for validation (Results) library(readxl) ❝ as in Phoenix (see Helmut's RSABE tutorial). The code needs to be tested via another data... I suspect deviations from SAS, because some values are not equal in full precision... OK, that would be my next task ![]() — Kind regards, Mittyri |
yjlee168 ★★★ ![]() ![]() Kaohsiung, Taiwan, 2015-04-20 23:34 (3623 d 21:46 ago) @ Helmut Posting: # 14720 Views: 24,218 |
|
Dear Helmut, ❝ I closed this thread. Since you have closed that thread, I like to thank you for this post first (very nice codes). But do you think that we should also present df, upper/lower CI (90% or 95%), and p values stuffs for lsmean? Or just keep it simple as you suggest? Thanks in advanced. — All the best, -- Yung-jin Lee bear v2.9.2:- created by Hsin-ya Lee & Yung-jin Lee Kaohsiung, Taiwan https://www.pkpd168.com/bear Download link (updated) -> here |
Helmut ★★★ ![]() ![]() Vienna, Austria, 2015-04-21 03:15 (3623 d 18:04 ago) @ yjlee168 Posting: # 14726 Views: 24,164 |
|
Hi Yung-jin, ❝ I like to thank you for this post first Welcome. ❝ (very nice codes). I would never (!) use such a code given the nice vectorization possible in R. It was only intended as an example to get the means without a model. ❝ But do you think that we should also present df, upper/lower CI (90% or 95%), and p values stuffs for lsmean? IMHO, the df makes sense since it tells us whether we pulled the right stuff from the model. The CI is nice to know but not necessary. If the CIs overlap there is no significant difference between treatments. So what? No agency asks for it. I never understood the purpose of the t- and p-values. What is tested here? A difference to zero or what? ❝ Or just keep it simple as you suggest? Please don’t think about using this awful code! — Dif-tor heh smusma 🖖🏼 Довге життя Україна! ![]() Helmut Schütz ![]() The quality of responses received is directly proportional to the quality of the question asked. 🚮 Science Quotes |
Astea ★★ Russia, 2016-11-03 00:43 (3061 d 19:37 ago) @ Helmut Posting: # 16767 Views: 20,719 |
|
Dear all! While reading tonns of posts I stil can't understand how do SAS has got such a unique position? The method C for replicate studies (that is random effect with interactions PROC MIXED) in R (not only in bear but also in other packages) doesn't exist, does it? As I understand only method A is available in bear and only for partial replicate designs 2x2x4, 2x2x6.. But what about fully replicated 2x4x4? VStus (in that post) mentioned that ❝ bear's lm.mod() was not confused by having more than 2 periods and 2 sequences Also a question appears what should we use as a reference variance in order to apply scaling of confidence intervals (fully replicated design allows us even to estimate intrasubject variability of reference drug for two pairs of R that is we can desintegrate 2x4x4 for two 2x2x4 and estimate R variance independently for both. How will choosing one of them affect the scaling and possibility to fail?) And the thing that is totally out of my mind: why should point estimation be affected by the way of analysis? As it was once shown by Helmut for balanced studies PE is just a means over periods and sequences. Why can't we do analogous in the case of inbalanced designs? — "Being in minority, even a minority of one, did not make you mad" |
VStus ★ Poland, 2016-11-06 12:34 (3058 d 07:45 ago) @ Astea Posting: # 16780 Views: 20,481 |
|
Dear Astea, ❝ As I understand only method A is available in bear and only for partial replicate designs 2x2x4, 2x2x6.. But what about fully replicated 2x4x4? VStus (in that post) mentioned that I meant 3- and 4-arm non-replicate studies in my post, exploratory pilot comparing 2 or 3 pilot formulations versus the Reference. lm() or PROC GLM is enough in this case. Regards, VStus |
StatR ☆ Turkey, 2017-02-03 14:53 (2969 d 05:27 ago) @ VStus Posting: # 17007 Views: 19,626 |
|
Hi dear all, First of all, I am sorry if my question is too stupid. I could not find the answer no matter how much I investigate. I am new in the area of bioequivalence, and recently I am interested in individual bioequivalence. Also, I am not so familiar with the lme4. I am trying to extract the variance components (sigmaBT^2, sigmaBR^2, sigmaWT^2, sigmaWR^2 and rho) of the model (Restricted Maximum Likelihood Estimation). My data is as follows: head(mydata) I am trying to do it by lmer function as follows: lmer(Yijk~Formula+Period+Sequence+(1|Sequence)) I know, the estimated value of sigmaWR^2 = 1.269e-01 and the mean difference Ft-Fr = 0.178645. But how can I get the estimated values of sigmaBT^2, sigmaBR^2, sigmaWT^2 and rho ? I appreciate any help. |
VStus ★ Poland, 2017-02-03 16:47 (2969 d 03:33 ago) @ StatR Posting: # 17009 Views: 19,214 |
|
Dear StatR, Sorry for confusion, deleted my incorrect reponse. summary(lmerdata) seems to be already provided.What is Yijk ? Yijk seems to be a PK paramenter of interest... Residual you've extracted seems to be pooled both formulations. Regards, VStus PS: Helmut, thank you for options(digits=12) ! |
StatR ☆ Turkey, 2017-02-03 18:12 (2969 d 02:08 ago) @ VStus Posting: # 17011 Views: 19,135 |
|
❝ Yijk seems to be a PK paramenter of interest... Residual you've extracted seems to be pooled both formulations. Dear VStur, Thanks for your reply. You are right, Yijk is PK characteristic of interest. The design is 2 sequence 2 treatment and 4 period design(TRTR/RTRT). More clearly, I want to extract between subject variances (sigmaBT^2, sigmaBR^2), within subject variances (sigmaWT^2, sigmaWR^2) under the test and reference formulation, also subject-by-formulation interaction (sigmaD^2 = sigmaBT^2 + sigmaBR^2 - 2*rho*sigmaBT*sigmaBR). Is it possible to obtain all of these estimates from the summary(lmer_model), or do I need to do an extra step to obtain those values? Thanks in advance 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] |
d_labes ★★★ Berlin, Germany, 2017-02-07 12:16 (2965 d 08:03 ago) @ StatR Posting: # 17029 Views: 19,020 |
|
Dear StatR, ❝ ... More clearly, I want to extract between subject variances (sigmaBT^2, sigmaBR^2), within subject variances (sigmaWT^2, sigmaWR^2) under the test and reference formulation, also subject-by-formulation interaction (sigmaD^2 = sigmaBT^2 + sigmaBR^2 - 2*rho*sigmaBT*sigmaBR). What is needed for that goal is to formulate a model which have these variance-covariance parameters. Your model is one with assuming sigmaWT = sigmaWR and sigmaBT=sigmaBR, rho=1. Thus you have only two variance-covariance parameters in your output above: Random effects: Unfortunately there is currently no way to formulate a model similar to the FDA code for replicate designs within package lme4 / lmer() . See f.i. this post for more details on the why.In the older package nlme / lme() you may formulate the model similar to the FDA code. See that post.But nevertheless you can't get the 'correct' CI from that R solution since the degrees of freedom for the contrast T-R are different to that of SAS Proc MIXED. Hope this helps. — Regards, Detlew |
StatR ☆ Turkey, 2017-02-07 12:36 (2965 d 07:43 ago) @ d_labes Posting: # 17030 Views: 18,945 |
|
❝ What is needed for that goal is to formulate a model which have these variance-covariance parameters. ❝ Your model is one with assuming sigmaWT = sigmaWR and sigmaBT=sigmaBR, rho=1. ❝ Thus you have only two variance-covariance parameters Dear d_labes, Thank you very much for the explanation. At least, now, I know what should I do. Best. |
StatR ☆ Turkey, 2017-02-08 09:41 (2964 d 10:39 ago) @ d_labes Posting: # 17033 Views: 18,909 |
|
Hi again d_labes, I tried to find the correct model by the post you referred. ❝ In the older package Unfortunately, I am confused after reading tons of post, and I could not figure out what is "trt", "tmt" ... Simply, my data is as follows Subject Formula Period Sequence Yijk Where Yijk is the PK characteristic. The first sequence represents "TRTR" and the second sequence: "RTRT". In the formula 1 = T and 0 = R. In the referred post you say that model2 <- lme(y~ drug + prd + seq, In your model y = Yijk, drug=Formula, prd=Period, seq=Sequence, but what is tmt? Also, is the my data format correct for the lme? Or, Should I change Formula as 1 = T, 2 = R and Sequence as 1 = TRTR, 2 = RTRT? Could you please make me clear. Best. |
d_labes ★★★ Berlin, Germany, 2017-02-08 11:13 (2964 d 09:07 ago) @ StatR Posting: # 17034 Views: 19,181 |
|
Dear StatR, sorry for confusing you. I was a little bit sloppy in the post and mixed the factor names in Bear with mine. To clarify my naming convention and coding: tmt is treatment coded as "T" or "R" period is period no sequence is sequence coded as "TRTR" or "RTRT" (or whatever you have) subject is subject no. y is log-transformed PK metric (Cmax or AUC or whatever you like to evaluate) Don't forget to make them as.factor()! Then call muddle <- lme(y ~ tmt + period + sequence, If you prefer your numeric coding of tmt = Formula and Sequence: Don't forget to make them as.factor()! Then call muddle <- lme(y ~ Formula + Period + Sequence, Using the dataset II from the EMA Q&A you will get the following output with my convention: Linear mixed-effects model fit by REML From that it is read (note that lme() works with SD instead of variances): s2wT = 0.09296929^2 Hope this helps. Homework: Identify the variance-covariance terms with your coding ![]() — Regards, Detlew |
StatR ☆ Turkey, 2017-02-08 11:19 (2964 d 09:00 ago) @ d_labes Posting: # 17035 Views: 18,883 |
|
Dear d_labes, The only thing that I say: Wow! I do not know how I thanks for this reply. Thank you! ❝ sorry for confusing you. I was a little bit sloppy in the post and mixed the factor names in Bear with mine. ❝ Homework: Identify the variance-covariance terms with your coding ![]() |
Helmut ★★★ ![]() ![]() Vienna, Austria, 2017-02-08 11:33 (2964 d 08:47 ago) @ StatR Posting: # 17036 Views: 19,078 |
|
Hi StatR, ❝ ❝ ❝ ❝ ❝ ❝ ❝ ❝ Where Yijk is the PK characteristic. The first sequence represents "TRTR" and the second sequence: "RTRT". In the formula 1 = T and 0 = R. Only a general remark about data structures in R. I suggest to code categorial (classification) variables as characters instead of numeric (Treatment, Sequence). It not only helps others to understand what you have meant without requiring an explanation (1=TRTR, 2=RTRT and 1=T, 0=R) but also models (e.g., lm() , lme() , lmer() ) will automatically treat them as factors. Avoid Formula and use Treatment or Formulation instead. Personally I prefer Treatment over Formulation for generality (imagine a food-effect study where we have the same formulation).Convert numeric variables (except the PK-response) to factors as well:
❝ Unfortunately, I am confused after reading tons of post, and I could not figure out what is "trt", "tmt" ... Always the treatment is meant. To add confusion in package bear Yung-jin uses drug . ![]() — Dif-tor heh smusma 🖖🏼 Довге життя Україна! ![]() Helmut Schütz ![]() The quality of responses received is directly proportional to the quality of the question asked. 🚮 Science Quotes |
StatR ☆ Turkey, 2017-02-08 11:49 (2964 d 08:30 ago) @ Helmut Posting: # 17037 Views: 18,932 |
|
Hi Helmut, Many thans for your suggestions. I think you are right, otherwise it's confusing. I got the message ![]() Best ❝ Only a general remark about data structures in R. I suggest to code categorial (classification) variables as characters instead of numeric (Treatment, Sequence). It not only helps others to understand what you have meant without requiring an explanation (1=TRTR, 2=RTRT and 1=T, 0=R) but also models (e.g., |