j_kevin ☆ Hong Kong, 20221208 10:41 (676 d 01:32 ago) Posting: # 23390 Views: 5,224 

Q1: May I ask why in 2*2*2 cross over design, SE = sqrt(MSE)*sqrt(2/N)? Here is the SAS code for the analysis of ABE with fully replicate design data. PROC MIXED; Q2: When should I write 1 1 and when should I write 1 1 in estimate statements? Here is the covariance output from SAS Covariance Parameter Estimates In replicate design, the intrasubject variabilities are still calculated from the residuals as in a 2way crossover, using: IntraCV_T = 100%*sqrt(exp(sig_WT^2)1) IntraCV_R = 100%*sqrt(exp(sig_WR^2)1) The data include 10 subjects and 5 in seq 1 and 5 in seq2. This is a 2*2*4, 2 sequence 2 treatment and 4 period design, 90% CI of T/R is (0.8450984199, 1.104975448) and point estimate is 0.9663400049. I tried to use CVfromCI function from R package PowerTOST to calculate CV, and here is my r code: 100*CVfromCI(alpha=0.05, lower=0.8450985339, upper=1.104975299, n=c(5,5), design="2x2x4") and I get CV = 25.24456. Q3: Is this CV a pooled CV? If I want to get CVwt and CVwr based on confidence interval, how can I do it using R package Q4: I try to use the formula 100%*sqrt(exp(sig_W^2)1) where sig_w^2 = (sig_wt^2+sig_wr^2)/2 to get the same CV(25.24456) based on the covariance output above, but the value is different. Is my calculation wrong? If so, can anyone please tell me the right way to get same CV? Many thanks! Edit: Code and results BBCoded; see also this post #10. [Helmut] 
Helmut ★★★ Vienna, Austria, 20221208 13:09 (675 d 23:03 ago) @ j_kevin Posting: # 23392 Views: 4,547 

Hi j_kevin, ❝ Q1: May I ask why in 2*2*2 cross over design, SE = sqrt(MSE)*sqrt(2/N)? Correct is $$SE=\sqrt{\frac{MSE}{2}\left(\frac{1}{n_1}+\frac{1}{n_2}\right),}\tag{1}$$ where \(\small{n_1}\) and \(\small{n_2}\) are the number of subjects in sequences \(\small{1}\) and \(\small{2}\), respectively.* If and only if sequences are balanced (\(\small{n_1=n_2\to N=n_1+n_2}\)) you can use $$\eqalign{SE&=\sqrt{\frac{2\,MSE}{N}}\\ &=\sqrt{MSE}\,\cdot\,\sqrt{\frac{2}{N}}}\tag{2}$$ instead. In order to avoid falling into a trap (i.e., using \((2)\) if \(\small{n_1\neq n_2}\)), I strongly recommend to use always \((1)\). ❝ Here is the SAS code for the analysis of ABE with fully replicate design data. ❝ ❝
❝ ❝ Q2: When should I write 1 1 and when should I write 1 1 in estimate statements? All software use lexical order. Hence, it depends how you coded test and reference, i.e., in the FDA’s SAScode as T and R . By default the comparison will be done R  T because in lexical order T > R and last one will act as the reference. If you have other ones, you may have to code TRT in ESTIMATE differently.❝ Here is the covariance output from SAS ❝ ❝
❝ ❝ In replicate design, the intrasubject variabilities are still calculated from the residuals as in a 2way crossover, using: ❝ IntraCV_T = 100%*sqrt(exp(sig_WT^2)1) ❝ IntraCV_R = 100%*sqrt(exp(sig_WR^2)1) If you remove the %, correct. ❝ The data include 10 subjects and 5 in seq 1 and 5 in seq2. This is a 2*2*4, 2 sequence 2 treatment and 4 period design, 90% CI of T/R is (0.8450984199, 1.104975448) and point estimate is 0.9663400049. ❝ I tried to use CVfromCI function from R package PowerTOST to calculate CV, and here is my r code: ❝ ❝ and I get CV = 25.24456. ❝ ❝ Q3: Is this CV a pooled CV? Correct, since the 90% CI is based on it. ❝ If I want to get CVwt and CVwr based on confidence interval, how can I do it using R package That’s not possible because there is an infinite number of combinations of CV_{wT} and CV_{wR} giving the same CV_{w}. Example:
❝ Q4: I try to use the formula 100%*sqrt(exp(sig_W^2)1) where sig_w^2 = (sig_wt^2+sig_wr^2)/2 to get the same CV(25.24456) based on the covariance output above, but the value is different. Is my calculation wrong? If so, can anyone please tell me the right way to get same CV? No idea, I don’s speak SAS. AFAIK, FA(2,2) is the subjectbyformulation interaction. 0.1507 is unusually large.
— Diftor heh smusma 🖖🏼 Довге життя Україна! _{} Helmut Schütz The quality of responses received is directly proportional to the quality of the question asked. 🚮 Science Quotes 
j_kevin ☆ Hong Kong, 20221209 08:28 (675 d 03:45 ago) @ Helmut Posting: # 23393 Views: 4,467 

Dear Helmut, Thanks for your detailed explanation. Based on your comments, I have other questions.Could you please take a took, thanks. ❝ ❝ Q1: May I ask why in 2*2*2 cross over design, SE = sqrt(MSE)*sqrt(2/N)? ❝ ❝ Correct is $$SE=\sqrt{\frac{MSE}{2}\left(\frac{1}{n_1}+\frac{1}{n_2}\right),}\tag{1}$$ ❝ where \(\small{n_1}\) and \(\small{n_2}\) are the number of subjects in sequences \(\small{1}\) and \(\small{2}\), respectively.* ❝ If and only if sequences are balanced (\(\small{n_1=n_2\to N=n_1+n_2}\)) you can use $$\eqalign{SE&=\sqrt{\frac{2\,MSE}{N}}\\&=\sqrt{MSE}\,\cdot\,\sqrt{\frac{2}{N}}}\tag{2}$$ ❝ instead. In order to avoid falling into a trap (i.e., using \((2)\) if \(\small{n_1\neq n_2}\)), I strongly recommend to use always \((1)\). New Q1: May I ask the formula to calculate SE in a 2*2*4 replicated design? I read your lection but I only find the formula to calculate in 2*2*2 design. Thanks. ❝ ❝ The data include 10 subjects and 5 in seq 1 and 5 in seq2. This is a 2*2*4, 2 sequence 2 treatment and 4 period design, 90% CI of T/R is (0.8450984199, 1.104975448) and point estimate is 0.9663400049. ❝ ❝ I tried to use CVfromCI function from R package PowerTOST to calculate CV, and here is my r code: ❝ ❝ ❝ ❝ and I get CV = 25.24456. ❝ ❝ ❝ ❝ Q3: Is this CV a pooled CV? ❝ ❝ Correct, since the 90% CI is based on it. New Q3: (1) When we talk about CV, do we usually mean CVwr(withinsubject variability of the reference treatment)? Because we need to use whether CVwr > 30% (Swr>0.294) or not to determine which bioequivalence method should use. (2) If the answer of (1) is yes, then why we need to calculate pooled CV from 90% CI if we only care about CVwr? Or if pooled CV is important, when will we need to use pooled CV to make any decision? (3) What's the relationship among CV(Sw), CVwr(Swr), CVwt(Swt)? For 2*2*2 design, is that S^2w = (S^2wr + S^2wt)/2, and CV=100*sqrt(exp(S^2w)1)? Will this formula change in 2*2*4 design? If it will change, could you please write the formula in 2*2*4 design? Thanks. Edit: Please don’t color your entire text. THX. [Helmut] 
Helmut ★★★ Vienna, Austria, 20221209 14:36 (674 d 21:37 ago) @ j_kevin Posting: # 23394 Views: 4,392 

Hi j_kevin, ❝ New Q1: May I ask the formula to calculate SE in a 2*2*4 replicated design? I read your lection but I only find the formula to calculate in 2*2*2 design. It’s the same one. ❝ New Q3: (1) When we talk about CV, do we usually mean CVwr(withinsubject variability of the reference treatment)? Because we need to use whether CVwr > 30% (Swr>0.294) or not to determine which bioequivalence method should use. When we talk about the CV in a crossover (simple 2×2×2, HigherOrder, or replicate) design, generally the intrasubject CV (CV_{w}) is meant. In parallel designs it’s the total CV (pooled from CV_{w} and CV_{b}). Only in referencescaling we are interested in the intrasubject CVs of treatments (CV_{wT} and CV_{wR}) as well. Of course, both are only accessible in full replicate designs. In the bloody partial replicate design we get only the latter. The former is nice to know (esp. in pilot studies when we want to estimate the sample size for a pivotal study; see there for an example). ❝ (2) If the answer of (1) is yes, then why we need to calculate pooled CV from 90% CI if we only care about CVwr? Or if pooled CV is important, when will we need to use pooled CV to make any decision? The implemented methods of referencescaling (RSABE for the FDA and China, ABEL in all other jurisdictions) are frameworks, where the decision whether RSABE/ABEL or ABE has to be applied hinges on the variability of the reference (see here and there). If RSABE is applicable (\(\small{s_{\text{wR}}^2\ge0.294}\)), we are not interested in the confidence interval; we assess only whether the upper bound of the linearized criterion is ≤0 and the PE lies within 80.00 – 125.00%. Only in ABE (\(\small{s_{\text{wR}}^2<0.294}\)) we assess the 90% CI. Contrary to that, in ABEL we assess always the 90% CI (if \(\small{CV_{\text{wR}}>30\%}\) within the expanded limits or within 80.00 – 125.00%, otherwise). ❝ (3) What's the relationship among CV(Sw), CVwr(Swr), CVwt(Swt)? For 2*2*2 design, is that S^2w = (S^2wr + S^2wt)/2, and CV=100*sqrt(exp(S^2w)1)? If the study is balanced, correct. Otherwise we would have to weigh the variances by the degrees of freedom. See also this post. ❝ Will this formula change in 2*2*4 design? If it will change, could you please write the formula in 2*2*4 design? First of all, you don’t need CV_{w} in replicate designs indended for referencescaling. A clumsy attempt for the EMA’s ‘Data set I’ (imbalanced and incomplete):
With rds25 of package replicateBE , which is both balanced and complete:
CI2CV() agree. Hence, my code for pooling variances is wrong.To complicate things: CV_{wT} and CV_{wR} could be directly estimated from the FDA’s mixedeffects model (as you did in your OP). With the EMA’s ‘Data set I’ we get CV_{wR} = 47.328% and CV_{wT} = 35.293%. However, this is not what the FDA wants. Instead, it has to be estimated by an ANOVA of the reference treatment’s data with subject and sequence as factors. Then we get CV_{wR} = 47.627%. Different, right? The REML PE of the mixedeffects model is 115.658% (90% CI: 107.104 – 124.894%). However, if we apply the FDA’s method acc. to the guidances for RSABE, we get a PE of 115.461% (90% CI: 106.386 – 125.311%). Different, again… As Mittyri once wrote: “Welcome to the hell of mixedeffects modeling.” BTW, you are not the first asking for CV_{w} in replicate designs. It’s on our todolist for the next release of the package replicateBE .— Diftor heh smusma 🖖🏼 Довге життя Україна! _{} Helmut Schütz The quality of responses received is directly proportional to the quality of the question asked. 🚮 Science Quotes 
ElMaestro ★★★ Denmark, 20221209 16:49 (674 d 19:24 ago) @ Helmut Posting: # 23395 Views: 4,337 

Hi all, this question boils down to "something" which is not so easy and straightforward. First of all, when going full mixed there is to the best of my knowledge no particular relevance of a CI2CV kind of function. It provides an answer to something which is not really asked, but which may be identical to the answer truly sought in case of balance (not even sure about this last part, need to read up on things). Now for the remainder, and this is everything based on the linear model as applied to replicated BE data, please bear in mind: 1. When we evaluate a subject, the guideline says the subject only contributes if she/he provides at least one T and one R measurement. ...but... 2. When we estimate swr, there is no equivalent wording. Look for example at subject 24 of EMA dataset I. The subject contributes with only one ref measurement. But in the grand scheme of things such a subject does not contribute to the withinref (try and fit dataset I for swr with and without that subject). The subject's data is estimated with no residual because there is only one measurement. So, as someone wrote in another thread in another galaxy, it is all in the df's. The estimate of swr (if we go the anova way as per EMA) has 71 dfs, and 69 for swt. But plugging the MSEs and df's into the equation for pooled variances still does not get you where you want to be (a pooled MSE reflecting the overall anova MSE if I got you right). And that's because of the fixed effect estimates that are allowed vary between the two anova's. Think about it. So, if you are looking for 'manual' and simple equations that allow you to swap back and forth between swr, swt and pooled variances, then I am afraid you are out of luck and you may be asking too much. You can easier get what you are looking for by working backwards from the matrix forms of the linear model. — Pass or fail! ElMaestro 
j_kevin ☆ Hong Kong, 20221214 14:12 (669 d 22:00 ago) @ Helmut Posting: # 23402 Views: 4,241 

Dear Helmut, Thanks for your detailed explanation. ❝ When we talk about the CV in a crossover (simple 2×2×2, HigherOrder, or replicate) design, generally the intrasubject CV (CVw) is meant. Question: Is CVw a pooled CV? So the CV we usually talk about is the pooled CV? The reason why I ask this question is when we do sample size calculation of bioequivalence study in clinical trails, I always see people write the CV of Cmax/AUC is XX%, I'm not sure whether the CV means CVw or CVwr. ❝ To complicate things: CVwT and CVwR could be directly estimated from the FDA’s mixedeffects model (as you did in your OP). ❝ If the study is balanced, correct. Otherwise we would have to weigh the variances by the degrees of freedom. See also this post. PROC MIXED; Question: Based on the code provided by FDA, I can get two residuals which are Swt and Swr. If I need to calculate confidence interval, then I should first determine whether the design is balanced or not, and then find appropriate way to calculate Sw based on Swt and Swr. Then use Sw to calculate CVw, then use CVw to calculate confidence interval. I can follow the link you provided above. Are those steps correct? Thanks. Edit: Standard quotes restored; see also this post #8. [Helmut] 
j_kevin ☆ Hong Kong, 20230102 04:06 (651 d 08:07 ago) @ Helmut Posting: # 23414 Views: 3,926 

Dear Helmut, Could you please take a look at my questions above. Many thanks. 
j_kevin ☆ Hong Kong, 20230102 06:07 (651 d 06:05 ago) @ Helmut Posting: # 23415 Views: 3,839 

Dear Helmut, Please neglect my previous first question and I change it a little bit. Looking forwatd to your reply. Thanks. ❝ When we talk about the CV in a crossover (simple 2×2×2, HigherOrder, or replicate) design, generally the intrasubject CV (CV_{w}) is meant. In parallel designs it’s the total CV (pooled from CV_{w} and CV_{b}). Only in referencescaling we are interested in the intrasubject CVs of treatments (CV_{wT} and CV_{wR}) as well. Of course, both are only accessible in full replicate designs. In the bloody partial replicate design we get only the latter. The former is nice to know (esp. in pilot studies when we want to estimate the sample size for a pivotal study; see there for an example). Question: In simple 2*2*2 cross over design, Can we still get Swr or Swt? Or we can only get those two values in replicate design? Is RSABE method can only be applied in replicate design? In parallel design, CV is the total(pooled) CV (pooled from CVw and CVb). Why we need to calculate pooled CV in parallel design? Will we use that pooled CV to calculate sample size? Or we only need to use CVw to calculate sample size. ❝ ❝ To complicate things: CVwT and CVwR could be directly estimated from the FDA’s mixedeffects model (as you did in your OP). ❝ ❝ If the study is balanced, correct. Otherwise we would have to weigh the variances by the degrees of freedom. See also this post. PROC MIXED; Question: If the design is replicated design and based on the code provided by FDA, I can get two seperate residuals which are Swt and Swr. However, the calculation of confidence intervcal is based on Sw instead of Swt or Swr. Hence, I should first determine whether the design is balanced or not, and then find appropriate way to calculate Sw based on Swt and Swr. Then use Sw to calculate CVw, then use CVw to calculate confidence interval. Are those steps correct? Thanks. Edit: Standard quotes restored; see also this post #8. [Helmut] 
Helmut ★★★ Vienna, Austria, 20230104 12:39 (648 d 23:34 ago) @ j_kevin Posting: # 23416 Views: 3,790 

Hi j_kevin, for background about variances accessible in different designs see there. ❝ In simple 2*2*2 cross over design, Can we still get Swr or Swt? No. We get only the within subject variance \(\small{s_\text{w}^2}\) (and, of course, the between subject variance \(\small{s_\text{b}^2}\) as well). As an aside, the model for BE assumes homoscedasticity \((\small{s_\text{wT}^2\equiv s_\text{wR}^2})\). Bad luck, if \(\small{s_\text{wR}^2>s_\text{wT}^2}\). The ‘good’ test product will be punished by the ‘bad’ referrence. ❝ Or we can only get those two values in replicate design? Is RSABE method can only be applied in replicate design? Yes and yes. ❝ In parallel design, CV is the total(pooled) CV (pooled from CVw and CVb). Why we need to calculate pooled CV in parallel design? Will we use that pooled CV to calculate sample size? Or we only need to use CVw to calculate sample size. If you have data of a previous study in a parallel design, you get just the total CV anyway. Only if you have a crossover study (\(\small{CV_\text{w}}\) and \(\small{CV_\text{b}}\)) you have to pool variances in order to estimate the sample size of a study in a parallel design. ❝ If the design is replicated design and based on the code provided by FDA, I can get two seperate residuals which are Swt and Swr. Correct. ❝ However, the calculation of confidence intervcal is based on Sw instead of Swt or Swr. See the applicable decision scheme (i.e., whether to use ABE or RSABE). For obscure reasons the FDA does not use \(\small{s_\text{wR}}\) estimated from the mixedeffects model, but from intrasubject contrasts of the reference treatment with sequence as a factor. See this post for an example. ❝ Hence, I should first determine whether the design is balanced or not, and then find appropriate way to calculate Sw based on Swt and Swr. Then use Sw to calculate CVw, then use CVw to calculate confidence interval. Are those steps correct? No. Follow the guidance. — Diftor heh smusma 🖖🏼 Довге життя Україна! _{} Helmut Schütz The quality of responses received is directly proportional to the quality of the question asked. 🚮 Science Quotes 