lizhao ☆ US, 2016-01-22 01:13 (3348 d 04:50 ago) Posting: # 15841 Views: 27,690 |
|
Dear All, I have a dataset that comes from a classical 2X2 crossover designed bioequivalence study. I wonder if somebody could share with me the R code that can be used to analyze this dataset??? Should I use lm() or lme() in R (considering subject effects as random?) Thanks a lot!!! |
ElMaestro ★★★ Denmark, 2016-01-22 01:59 (3348 d 04:04 ago) @ lizhao Posting: # 15842 Views: 26,029 |
|
Hi Lizhao, it is not too difficult. You can use lm in the form of something like: Mod = lm(lnCmax ~Trt+Seq+Subj+Per) An easy option for the direct treatment effects is to use Mod = lm(lnCmax ~0+Trt+Seq+Subj+Per) and then you have the treatment effects directly out of the fixed effects or model summaries for Mod .To generate a type III anova you can use drop1(Mod, test="F") To generate the confidence interval, you just need the critical value at your chosen alpha and df, the fixed treatment effects (estimates thereof), and the SE which is calculated from the model's MSE and from the sequence sample sizes (which determine df too). You can find some code via this link. Good luck. If you get stuck, send an email. — Pass or fail! ElMaestro |
lizhao ☆ US, 2016-01-22 02:26 (3348 d 03:36 ago) @ ElMaestro Posting: # 15843 Views: 26,143 |
|
Hi ElMaestro, Thank you very much for your help. I do have a question about using lm() instead of lme() function in R. Based on my understanding, subject effect should be considered to be random effect ![]() Another question would be related to plot mean curves of Test and Reference product. If I want to plot a mean plot (mean and error bars) of a crossover biequivalence study, should I use within-subject confidence intervals or between-subject confidence intervals? They are apparently quite different. Thanks again! |
ElMaestro ★★★ Denmark, 2016-01-22 13:13 (3347 d 16:50 ago) @ lizhao Posting: # 15844 Views: 26,090 |
|
Hi Lizhao, ❝ Thank you very much for your help. I do have a question about using lm() instead of lme() function in R. Based on my understanding, subject effect should be considered to be random effect Actually, you will see that FDA own SAS code for analysis of 222BE-studies involves PROC GLM, and this will always fit all effects as fixed. Hence lm in R. This despite the fact that Chow&Liu mentions the subject effect as random. It turns out that when you run the analysis on completers (completers only!) then PROC GLM/lm or a mixed effect model will achieve exactly the same. The beauty of PROC GLM/lm is that you get a well-defined anova along with it if you want. A well-defined anova doesn't exist for mixed models (but anovas of sorts can still be constructed). You will also see that in FDA's code for 222BE which is based on PROC GLM there is a random statement pertaining to subject. One should think this means we are now asking PROC GLM to add a random effect (and thus to analyse as a mixed model), perhaps. It doesnt, though. PROC GLM with the random statement for subject still treats subject as a fixed effect. The bogus statement achieves another goal and compares sequence against the subject MS, and for that there is no direct equivalent in R, and this is why will see that there is a difference in the ANOVAs generated from PROC GLM and R's drop1.Both can be argued to be correct, but since mass hysteria and brainlessness have trumped common sense in recent years everyone and his cousin just seem to want to reproduce PROC GLM's output without any questions asked. ❝ Another question would be related to plot mean curves of Test and Reference product. If I want to plot a mean plot (mean and error bars) of a crossover biequivalence study, should I use within-subject confidence intervals or between-subject confidence intervals? They are apparently quite different. I think you can plot those curves in any way you want? The BE decision is taken on basis of the CI's. If you plot Conc versus time and average across subjects then you would often choose to use between-subject variances for error bars. — Pass or fail! ElMaestro |
d_labes ★★★ Berlin, Germany, 2016-01-27 10:57 (3342 d 19:06 ago) @ ElMaestro Posting: # 15862 Views: 25,734 |
|
Dear ElMaestro! Do you have a reference document for your mentioned FDA 'own' SAS code for 2x2 crossover based on Proc GLM with the "bogus" random statement?Count up - post 999 — Regards, Detlew |
nobody nothing 2016-01-27 11:09 (3342 d 18:54 ago) @ d_labes Posting: # 15863 Views: 25,670 |
|
"If you get stuck, send an email." totally OT: Is the email functionality of the forum back? Last time I wanted to invite myself via email for a cup of coffee in Denmark while travelling ![]() — Kindest regards, nobody |
Helmut ★★★ ![]() ![]() Vienna, Austria, 2016-01-27 14:39 (3342 d 15:23 ago) @ nobody Posting: # 15864 Views: 25,528 |
|
Hi nobody, ❝ totally OT: Is the email functionality of the forum back? It is. ❝ Last time I wanted to invite myself via email for a cup of coffee in Denmark while travelling ElMaestro’s ISP and mine have a long history of blacklisting each other. Since 2008 we exchanged 1200+ Mehls and occasionally they bounced. No idea why. @ElMaestro: Consider changing your address to …@ymail.com. — Dif-tor heh smusma 🖖🏼 Довге життя Україна! ![]() Helmut Schütz ![]() The quality of responses received is directly proportional to the quality of the question asked. 🚮 Science Quotes |
ElMaestro ★★★ Denmark, 2016-01-27 14:47 (3342 d 15:16 ago) @ nobody Posting: # 15865 Views: 25,519 |
|
Hi nobody, ❝ totally OT: Is the email functionality of the forum back? Last time I wanted to invite myself via email for a cup of coffee in Denmark while travelling My coffee-maker broke down so I simply had to ask Helmut to deactivate the forum's email function temporarily. ![]() ![]() ![]() And while we are at it, here is a link to one of the better poems I read recently. Want a coffee appointment in Shitville? Then click here for a direct email option. — Pass or fail! ElMaestro |
Helmut ★★★ ![]() ![]() Vienna, Austria, 2016-01-27 14:51 (3342 d 15:12 ago) @ ElMaestro Posting: # 15866 Views: 26,059 |
|
Hi ElMaestro & Lizhao, ❝ ❝ If I want to plot a mean plot (mean and error bars) of a crossover biequivalence study, should I use within-subject confidence intervals or between-subject confidence intervals? ❝ ❝ I think you can plot those curves in any way you want? The BE decision is taken on basis of the CI's. ❝ If you plot Conc versus time and average across subjects then you would often choose to use between-subject variances for error bars. Between – yes. (m/V)2? Ahem… I suggest to plot geometric means* ± backtransformed standard deviations. Concentrations likely follow a log-normal distribution. Arithmetic means ± SD can lead to bizarre plots (like this one published by the FDA, page 12 of the PDF).
— Dif-tor heh smusma 🖖🏼 Довге життя Україна! ![]() Helmut Schütz ![]() The quality of responses received is directly proportional to the quality of the question asked. 🚮 Science Quotes |
nobody nothing 2016-01-27 16:20 (3342 d 13:43 ago) @ Helmut Posting: # 15868 Views: 25,579 |
|
❝ "...like this one published by the FDA, page 12 of the PDF" This plot is REALLY worth its money, quote "Study PR08210 enrolled 252 subjects and 238 completed the study". Made my day! — Kindest regards, nobody |
Helmut ★★★ ![]() ![]() Vienna, Austria, 2016-01-27 17:11 (3342 d 12:52 ago) @ nobody Posting: # 15869 Views: 25,605 |
|
Hi nobody, ❝ This plot is REALLY worth its money, quote "Study PR08210 enrolled 252 subjects and 238 completed the study". Made my day! Did you realize that it was a 4-period full replicate study? — Dif-tor heh smusma 🖖🏼 Довге життя Україна! ![]() Helmut Schütz ![]() The quality of responses received is directly proportional to the quality of the question asked. 🚮 Science Quotes |
nobody nothing 2016-01-27 17:31 (3342 d 12:32 ago) @ Helmut Posting: # 15870 Views: 25,426 |
|
❝ Did you realize that it was a 4-period full replicate study? That's enough for the rest of the week! ![]() — Kindest regards, nobody |
kumarnaidu ★ Mumbai, India, 2016-11-04 15:05 (3060 d 14:58 ago) @ nobody Posting: # 16773 Views: 23,581 |
|
Hello All, Recently we got one query from WHO for 2x2 crossover study "Please take into account that if a mixed effect ANOVA model with the main effects of treatment, period and sequence as fixed effect and subjects nested within sequence as random effect is going to be used, as defined in the protocol, in SAS this refers to PROC MIXED as defined in the FDA guidelines. However, the protocol states at the same time that the sequence effect will be tested using the subjects nested within sequence mean square from the ANOVA as the error term. All other main effects will be tested against the residual error (mean square error/MSE) from the ANOVA as the error term. This refers to PROC GLM of SAS. This inconsistency should be corrected." As per some experts if we want to keep sub(seq) as a error term for testing seq then it should be random rather than fixed. But as I understand all effects in the PROC GLM are fixed including sub(seq). Can anybody help me out? Thanks in advance. — Kumar Naidu |
mittyri ★★ Russia, 2016-11-05 00:00 (3060 d 06:03 ago) @ kumarnaidu Posting: # 16774 Views: 23,470 |
|
Dear Kumar, I would cite one of our Gurus: You will also see that in FDA's code for 222BE which is based on PROC GLM there is a random statement pertaining to subject. One should think this means we are now asking PROC GLM to add a random effect (and thus to analyse as a mixed model), perhaps. It doesnt, though. PROC GLM with the random statement for subject still treats subject as a fixed effect. The bogus statement achieves another goal and compares sequence against the subject MS *--- GLM evaluation, output of T-R; Seems to be odd but here Subject is still fixed as ElMaestro wrote. So the experts are right (and ElMaestro too ![]() — Kind regards, Mittyri |
kumarnaidu ★ Mumbai, India, 2016-11-05 06:22 (3059 d 23:41 ago) @ mittyri Posting: # 16775 Views: 23,454 |
|
Hi Mittyri Thanks for your reply. ❝ Seems to be odd but here Subject is still fixed as ElMaestro wrote. So the experts are right (and ElMaestro too Ok that means sub(seq) is a random effect in proc glm. But what about above query from WHO. Also in EMA que and answer guidance they said all effects should be fixed rather than random (method A). Also as you said there is no meaning of random statement in proc glm. EMA Method also dont have such statement. My confusion is that in the protocol can we write that sub, period, sequence, treatment and sub(seq) will be a fixed effects and seq will be tested against sub(seq) if I am going to use Proc glm. Thanks — Kumar Naidu |
mittyri ★★ Russia, 2016-11-05 11:13 (3059 d 18:50 ago) @ kumarnaidu Posting: # 16776 Views: 23,562 |
|
Hi Kumar, ❝ Ok that means sub(seq) is a random effect in proc glm. Nope! Subject is still fixed, because you are using PROC GLM. Please see the guide: Note:PROC GLM uses only the information pertaining to expected mean squares when you specify the TEST option in the RANDOM statement and, even then, only in the extra tests produced by the RANDOM statement. Other features in the GLM procedure—including the results of the LSMEANS and ESTIMATE statements—assume that all effects are fixed, so that all tests and estimability checks for these statements are based on a fixed-effects model, even when you use a RANDOM statement. ❝ But what about above query from WHO. They just want to see unambiguity in your statement. ❝ Also in EMA que and answer guidance they said all effects should be fixed rather than random (method A). Also as you said there is no meaning of random statement in proc glm. EMA Method also dont have such statement. Are you working with Replicate study? The things are different there ❝ My confusion is that in the protocol can we write that sub, period, sequence, treatment and sub(seq) will be a fixed effects and seq will be tested against sub(seq) if I am going to use Proc glm. I think you can provide the SAS code above, so all experts will understand that all effects are still fixed, and the reason of random part there is just an F test. — Kind regards, Mittyri |
kumarnaidu ★ Mumbai, India, 2016-11-07 07:24 (3057 d 22:39 ago) @ mittyri Posting: # 16783 Views: 23,466 |
|
Dear Mittyri and all, ❝ Are you working with Replicate study? The things are different there Its a 2x2 crossover study. ❝ I think you can provide the SAS code above, so all experts will understand that all effects are still fixed, and the reason of random part there is just an F test. proc glm data=replicate; class formulation subject period sequence; model logDATA= sequence subject (sequence) period formulation; estimate "test-ref" formulation -1+1; test h=sequence e=subject(sequence); lsmeans formulation / adjust=t pdiff=control("R") CL alpha=0.10; run; This is Method A from EMA Q&A guidance. Ideally in GLM all effects are fixed. Can we call here sub(seq) as a fixed effect? — Kumar Naidu |
mittyri ★★ Russia, 2016-11-07 12:57 (3057 d 17:06 ago) @ kumarnaidu Posting: # 16784 Views: 23,219 |
|
Dear Kumar, ❝ This is Method A from EMA Q&A guidance. Ideally in GLM all effects are fixed. ❝ Can we call here sub(seq) as a fixed effect? yes, you can. I kindly suggest to review the statistical part of the protocol with statistician experienced in BEQ studies evaluation. It would be useful for you, for this study and for the product. EOD from my side. — Kind regards, Mittyri |
kumarnaidu ★ Mumbai, India, 2016-11-07 13:42 (3057 d 16:20 ago) @ mittyri Posting: # 16785 Views: 23,504 |
|
Thanks Mittyri, ❝ yes, you can. ❝ I kindly suggest to review the statistical part of the protocol with statistician experienced in BEQ studies evaluation. It would be useful for you, for this study and for the product. ![]() — Kumar Naidu |
Ben ★ 2016-11-08 22:20 (3056 d 07:43 ago) @ Helmut Posting: # 16789 Views: 23,342 |
|
Dear Helmut, ❝ I suggest to plot geometric means* ± backtransformed standard deviations. Concentrations likely follow a log-normal distribution. We should bear in mind that when we back transform to the original scale we end up with asymmetry with respect to +/-. Therefore, it is IMHO not appropriate to do +/- back transformed standard deviation. Symmetry is however obtained with respect to * and /. So the error bars should be such that lower end = gMean / gSD and upper end = gMean * gSD, where gSD = exp(standard deviation from log-transformed values). [Mathematical rationale: exp(m - s) = exp(m)/exp(s) = gMean / gSD and exp(m + s) = exp(m) * exp(s) = gMean * gSD), where m and s are mean and sd on log scale, respectively] Best regards, Ben. |
Helmut ★★★ ![]() ![]() Vienna, Austria, 2016-11-09 16:29 (3055 d 13:34 ago) @ Ben Posting: # 16793 Views: 23,185 |
|
Dear Ben, ❝ We should bear in mind that when we back transform to the original scale we end up with asymmetry with respect to +/-. This is exactly the idea – reflecting the distributional properties of the data: length of upper / lower whiskers: ❝ Therefore, it is IMHO not appropriate to do +/- back transformed standard deviation. Symmetry is however obtained with respect to * and /. So the error bars should be such that lower end = gMean / gSD and upper end = gMean * gSD, where gSD = exp(standard deviation from log-transformed values). ❝ [Mathematical rationale: exp(m - s) = exp(m)/exp(s) = gMean / gSD and exp(m + s) = exp(m) * exp(s) = gMean * gSD), where m and s are mean and sd on log scale, respectively] Can’t agree more. I did not express myself clearly. Blue your method and red the one* I meant. Of course they are equivalent.
— Dif-tor heh smusma 🖖🏼 Довге життя Україна! ![]() Helmut Schütz ![]() The quality of responses received is directly proportional to the quality of the question asked. 🚮 Science Quotes |
Ben ★ 2016-11-14 20:40 (3050 d 09:22 ago) @ Helmut Posting: # 16802 Views: 22,803 |
|
I see, then everything is fine ![]() ❝ Also used in Phoenix/WinNonlin. ❝ ────────────── ❝ Recipe ... Ha! Great, thanks. The PK guys always told me that it is not possible to create such error bars in WinNonlin. From now on I can refer to this recipe ![]() Best regards, Ben. |
Helmut ★★★ ![]() ![]() Vienna, Austria, 2016-11-14 22:50 (3050 d 07:13 ago) @ Ben Posting: # 16803 Views: 22,874 |
|
Hi Ben, ❝ The PK guys always told me that it is not possible to create such error bars in WinNonlin. Possible for years! These guys should either RTFM or consult Certara’s forum. Last time I posted the recipe was two years ago. — Dif-tor heh smusma 🖖🏼 Довге життя Україна! ![]() Helmut Schütz ![]() The quality of responses received is directly proportional to the quality of the question asked. 🚮 Science Quotes |