lizhao Junior US, 20160122 00:13 Posting: # 15841 Views: 10,609 

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 Hero Denmark, 20160122 00:59 @ lizhao Posting: # 15842 Views: 9,787 

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. — “A tenyear, doubleblind study from the Mayo Clinic concluded that even in late stages of dementia, the last to go is the lobe of the brain in charge of cafeteria layout.” (Serge Storms/Tim Dorsey). Best regards, ElMaestro  Bootstrapping is a relatively new hobby of mine. I am only 30 years late to the party. 
lizhao Junior US, 20160122 01:26 @ ElMaestro Posting: # 15843 Views: 9,710 

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? If I use lm(), all effects are treated as fixed effects. You suggest me to use lm, is it based on FDA or EMA guidance? 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 withinsubject confidence intervals or betweensubject confidence intervals? They are apparently quite different. Thanks again! 
ElMaestro Hero Denmark, 20160122 12:13 @ lizhao Posting: # 15844 Views: 9,738 

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? If I use lm(), all effects are treated as fixed effects. You suggest me to use lm, is it based on FDA or EMA guidance? Actually, you will see that FDA own SAS code for analysis of 222BEstudies 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 welldefined anova along with it if you want. A welldefined 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 withinsubject confidence intervals or betweensubject 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 betweensubject variances for error bars. — “A tenyear, doubleblind study from the Mayo Clinic concluded that even in late stages of dementia, the last to go is the lobe of the brain in charge of cafeteria layout.” (Serge Storms/Tim Dorsey). Best regards, ElMaestro  Bootstrapping is a relatively new hobby of mine. I am only 30 years late to the party. 
d_labes Hero Berlin, Germany, 20160127 09:57 @ ElMaestro Posting: # 15862 Views: 9,448 

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 Senior 20160127 10:09 @ d_labes Posting: # 15863 Views: 9,362 

"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 I tried of no avail... — Kindest regards, nobody 
Helmut Hero Vienna, Austria, 20160127 13:39 @ nobody Posting: # 15864 Views: 9,276 

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 I tried of no avail... 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. — Cheers, Helmut Schütz The quality of responses received is directly proportional to the quality of the question asked. ☼ Science Quotes 
ElMaestro Hero Denmark, 20160127 13:47 @ nobody Posting: # 15865 Views: 9,269 

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 I tried of no avail... My coffeemaker broke down so I simply had to ask Helmut to deactivate the forum's email function temporarily. Sorry about it. I am now using a manual drip filter (like switching from Windows 10 back to 3.1) and Helmut is trying to figure out which button to click in order to restore the forum's email capability. Have faith. Miracles will happen. 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. — “A tenyear, doubleblind study from the Mayo Clinic concluded that even in late stages of dementia, the last to go is the lobe of the brain in charge of cafeteria layout.” (Serge Storms/Tim Dorsey). Best regards, ElMaestro  Bootstrapping is a relatively new hobby of mine. I am only 30 years late to the party. 
Helmut Hero Vienna, Austria, 20160127 13:51 @ ElMaestro Posting: # 15866 Views: 9,373 

Hi ElMaestro & Lizhao, » » If I want to plot a mean plot (mean and error bars) of a crossover biequivalence study, should I use withinsubject confidence intervals or betweensubject 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 betweensubject variances for error bars. Between – yes. (m/V)^{2}? Ahem… I suggest to plot geometric means* ± backtransformed standard deviations. Concentrations likely follow a lognormal distribution. Arithmetic means ± SD can lead to bizarre plots (like this one published by the FDA, page 12 of the PDF).
— Cheers, Helmut Schütz The quality of responses received is directly proportional to the quality of the question asked. ☼ Science Quotes 
nobody Senior 20160127 15:20 @ Helmut Posting: # 15868 Views: 9,271 

» "...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 Hero Vienna, Austria, 20160127 16:11 @ nobody Posting: # 15869 Views: 9,307 

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 4period full replicate study? — Cheers, Helmut Schütz The quality of responses received is directly proportional to the quality of the question asked. ☼ Science Quotes 
nobody Senior 20160127 16:31 @ Helmut Posting: # 15870 Views: 9,211 

» Did you realize that it was a 4period full replicate study? That's enough for the rest of the week! ...but wait: How to get 238 completers? In prison? ooops, sorry, now I saw it... — Kindest regards, nobody 
kumarnaidu Regular Mumbai, India, 20161104 14:05 @ nobody Posting: # 16773 Views: 7,269 

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 Senior Russia, 20161104 23:00 @ kumarnaidu Posting: # 16774 Views: 7,212 

Dear Kumar, I would cite one of our Guru: 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 TR; 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 Regular Mumbai, India, 20161105 05:22 @ mittyri Posting: # 16775 Views: 7,218 

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 Senior Russia, 20161105 10:13 @ kumarnaidu Posting: # 16776 Views: 7,259 

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 fixedeffects 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 Regular Mumbai, India, 20161107 06:24 @ mittyri Posting: # 16783 Views: 7,104 

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 "testref" 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 Senior Russia, 20161107 11:57 @ kumarnaidu Posting: # 16784 Views: 7,046 

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 Regular Mumbai, India, 20161107 12:42 @ mittyri Posting: # 16785 Views: 7,001 

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. The confusion arises due to the difference in the opinion . Some CRO stat experts says all effects in the above program are fixed and some says that sub(seq) cannot be a fixed because we are test seq against this. Also the EMA guidance says that all effects are fixed in the Method A (PROC GLM). — Kumar Naidu 
Ben Regular 20161108 21:20 @ Helmut Posting: # 16789 Views: 6,961 

Dear Helmut, » I suggest to plot geometric means* ± backtransformed standard deviations. Concentrations likely follow a lognormal 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 logtransformed 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 Hero Vienna, Austria, 20161109 15:29 @ Ben Posting: # 16793 Views: 6,891 

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 logtransformed 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.
— Cheers, Helmut Schütz The quality of responses received is directly proportional to the quality of the question asked. ☼ Science Quotes 
Ben Regular 20161114 19:40 @ Helmut Posting: # 16802 Views: 6,652 

I see, then everything is fine Thanks for the clarification! » 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 Hero Vienna, Austria, 20161114 21:50 @ Ben Posting: # 16803 Views: 6,654 

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. — Cheers, Helmut Schütz The quality of responses received is directly proportional to the quality of the question asked. ☼ Science Quotes 