d_labes ★★★ Berlin, Germany, 2010-04-22 13:43 (5467 d 07:47 ago) Posting: # 5183 Views: 61,842 |
|
Dear all, especially dear bears, since I'm very interested in using R for evaluation of BE studies I had a closer look at the bear code for parallel group studies (code inspection as part of validation ![]() If I got it right the code used is (f.i. AUC log-transformed): lme(lnAUC0t ~ drug, random=~1|subj, data=TotalData, method="REML" ) I am wondering where this code comes from, what this code does an why it works anyhow ![]() IMHO this model, one (fixed) effect for the treatment and one (random) effect for the subjects must be over-specified. We have only one value for a distinct subject treated with Test or Reference and thus we are not able to separate this uniquely into 2 effects, one part for treatment and one attributed to the subject. Nevertheless the lme() call produces a result. Try it out in bear. If I follow the strange and crude EMA suggestion and use all effects as fixed lmModel <- lm(lnAUC0t ~ drug + subj, data=TotalData) with the bear built-in dataset for parallel groups I get the anticipated result:
>summary(lmModel) BTW: I would go for a parallel groups study with exactly 2 groups with the 'simple' t-test (Welch variant as described by Helmut long ago) ![]() Is anybody out there who knows a generalization of the Welch test to more than 2 groups? Any hint would be very appreciated! Or could we use pairwise Welch t-tests for that? — Regards, Detlew |
ElMaestro ★★★ Denmark, 2010-04-22 14:53 (5467 d 06:36 ago) @ d_labes Posting: # 5184 Views: 58,203 |
|
Ahoy d_labes! ❝ If I got it right the code used is (f.i. AUC log-transformed): ❝ ❝ I am wondering where this code comes from, what this code does an why it works anyhow ❝ IMHO this model, one (fixed) effect for the treatment and one (random) effect for the subjects must be over-specified. With REML, the likelihood is optimised on the covariance matrix V (=ZGZt+R). With "random=~1|subj" I think we do the most simple specification of V, as we put in sigma on the diagonal, and zeros elsewhere. Thus, subjects introduce a random effect (think sigma on the diagonal), nature of treatment not considered. ❝ We have only one value for a distinct subject treated with Test or Reference and thus we are not able to separate this uniquely into 2 effects, one part for treatment and one attributed to the subject. In my opinion, and I could be wrong, with this specification of the model we are not trying to do exactly that through the proposed code. We are only saying that each subject is associated with a degree of variability which is described by a common sigma in V, regardless of the treatment given for any data point. Best regards from the seven seas, EM. Correction: I mean sigma2 on the diagonal. — Pass or fail! ElMaestro |
d_labes ★★★ Berlin, Germany, 2010-04-22 16:00 (5467 d 05:30 ago) @ ElMaestro Posting: # 5186 Views: 58,369 |
|
Ahoy ElMaestro! ❝ In my opinion, and I could be wrong, with this specification of the model we are not trying to do exactly that [...] (underlined by me ![]() There is a hint I meanwhile discovered: Also the summary() function works on the lme-model intervals() does not: > intervals(lmeModel, level=0.9) .Only the fixed effects parameter can be obtained, astonishing enough ![]() > intervals(lmeModel, which="fixed", level=0.9) Seems to me as there is something wrong with the random part. — Regards, Detlew |
ElMaestro ★★★ Denmark, 2010-04-22 23:47 (5466 d 21:43 ago) @ d_labes Posting: # 5188 Views: 58,350 |
|
Dear d_labes, ❝ Seems to me as there is something wrong with the random part. OK, then here's a potential theory: if we do lme(lnAUC0t ~ drug, random=~1|subj, data=TotalData, method="REML" ) on a dataset where we have parallel non-replicated groups (one observation per subject) then R might be trying to actually fit the error sigma2 on the diagonal of V (R matrix), and for ZGZt possibly ending up with a subject sigma2 on the diagonal. Since there is only one observation per subject, I guess this would amount to a V with error-sigma2 plus subject-sigma2 on the diagonal. Now error-sigma2 plus subject-sigma2 can be estimated, but the individual components cannot (would explain anomalies, at least). We would effectively only be working with a single sigma2. In this case, I would be inclined to imagine that the error-sigma2 plus subject-sigma2 would equal the residual error from an anova on lm(lnAUC0t~drug) or something like that. Best regards EM. — Pass or fail! ElMaestro |
d_labes ★★★ Berlin, Germany, 2010-04-23 11:09 (5466 d 10:20 ago) @ ElMaestro Posting: # 5192 Views: 58,228 |
|
Dear Old saylor, ❝ In this case, I would be inclined to imagine that the error-sigma2 plus subject-sigma2 would equal the residual error from an anova on lm(lnAUC0t~drug) or something like that. Full ACK. To verify this (bear v 2.4.1 parallel group dataset): 'Mixed effects model' Random effects: ElGrandeEM model: Call: Note the totally identical results for the 'drug' effects. — Regards, Detlew |
yjlee168 ★★★ ![]() ![]() Kaohsiung, Taiwan, 2010-04-26 01:29 (5463 d 20:01 ago) @ d_labes Posting: # 5218 Views: 58,130 |
|
Dear d_labes, ❝ There is a hint I meanwhile discovered: ❝ Also the summary() function works on the lme-model intervals() does not: ❝ ❝ Error in intervals.lme(lmeModel) : ❝ definite approximate variance-covariance. I got the following results for ln(Cmax) using built-in dataset for parallel study in bear v2.4.2 with the model of lme(lnCmax ~ drug, random=~1|subj, data=TotalData, method="REML"). Approximate 90% confidence intervals — 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 |
yjlee168 ★★★ ![]() ![]() Kaohsiung, Taiwan, 2010-04-23 01:09 (5466 d 20:21 ago) @ d_labes Posting: # 5189 Views: 58,093 |
|
Dear d_labes & ElMaestro, ❝ Call: ❝ lm(formula = lnAUC0t ~ drug + subj, data = TotalData) Is this possible caused by unbalanced parallel data set? I changed the built-in dataset in the demo of parallel study as an unbalanced (subject in Test: 14's and 13's in Ref.) since bear v2.4.2 because it could cause error with previous version when the parallel was unbalanced when doing NCA. You can see the output file called Statistical_summaries.txt after running the demo dataset for more details. Therefore, I don't know if it is appropriate to use lm() to run unbalanced dataset as you did here. The reason to do that is only for my convenience when coding bear and testing it. The unbalanced dataset is quite special for an unbalanced, parallel BE study in bear. I got the bug information from a Greek user. ❝ Residuals: ❝ ALL 20 residuals are 0: no residual degrees of freedom! ❝ (over-specified!) ❝ ❝ Coefficients: (1 not defined because of singularities) ❝ Estimate Std. Error t value Pr(>|t|) ❝ (Intercept) 7.3199 NA NA NA ❝ drug2 -0.0622 NA NA NA ❝ subj2 -0.5366 NA NA NA ❝ [...] — 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 |
d_labes ★★★ Berlin, Germany, 2010-04-23 11:12 (5466 d 10:17 ago) @ yjlee168 Posting: # 5193 Views: 58,163 |
|
Dear Yung-jin, ❝ Is this possible caused by unbalanced parallel data set? ![]() ❝ ... Therefore, I don't know if it is appropriate to use lm() to run unbalanced dataset as you did here. IMHO definitely yes. BTW: My preferred lm() model would be EMs above ![]() But if we consider different variabilities in the treatment groups it is another story! To ask it again: What is the idea behind your model, where does it come from? Do you have a reference for me? lm() or lme() is only a question of considering some effects as random or not.— Regards, Detlew |
yjlee168 ★★★ ![]() ![]() Kaohsiung, Taiwan, 2010-04-23 23:14 (5465 d 22:16 ago) @ d_labes Posting: # 5207 Views: 58,031 |
|
Dear d_labes, Thank you for your message. ❝ IMHO definitely yes. O.k. ❝ To ask it again: What is the idea behind your model, where does it come from? Do you have a reference for me? No reference for this. Simply try to translate the codes of Power to know into R. When we were developing bear for parallel BE study, we tried to get exactly the same results as Power to know or WinNonlin. The codes of Power to know for parallel BE study looks like
PROC GLM DATA=EXAMPLE; So we used lme() (not lm() ) to meet this requirement for validation purpose. lmeCmax_ss<-lme(Cmax_ss ~ drug, random=~1|subj, data=Data, method="REML" ) Just like analyzing a replicate crossover. I can not find the results obtained from analyzing with WinNonlin using a linear mixed effects model. As far as I could remember, we got pretty similar results as with WinNonlin at that moment. Then when search the answer for your question int his thread, I find that we probably can simply use lm() as what we do in non-replicate 2x2x2 crossover BE study, such aslmCmax_ss<- lm(Cmax_ss ~ drug , data=TotalData) Which model is more appropriate for analyzing parallel BE study with R? — 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, 2010-04-24 02:28 (5465 d 19:02 ago) @ yjlee168 Posting: # 5208 Views: 58,258 |
|
Dear bears! ❝ Just like analyzing a replicate crossover. I can not find the results obtained from analyzing with WinNonlin using a linear mixed effects model. As far as I could remember, we got pretty similar results as with WinNonlin at that moment. D. Labes referred to one of my old posts: WinNonlin's method (assuming equal variances) is flawed - even in the current releases WinNonlin 5.3 and Phoenix/WinNonlin 6.1. The model is equivalent to the common one-way ANOVA (but like everything in WinNonlin based on maximum likelihood); only one fixed effect = treatment (no random subject term whatsoever). A random subject term does not make sense IMHO. ❝ Which model is more appropriate for analyzing parallel BE study with R? Agreeing with D. Labes in the top post I would also use a t-test for unequal variances. That's the default of t.test and in conformity with FDA's requirements. For simple code see the subsequent post in the quoted thread.— 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, 2010-04-24 21:36 (5464 d 23:54 ago) @ Helmut Posting: # 5213 Views: 58,129 |
|
Dear Helmut, d_labes and ElMaestro, Thank you all for your great inputs and suggestions in this thread. We have decided to rewrite the codes of bear in the part of parallel BE study. ❝ D. Labes referred to one of my old posts: WinNonlin's method (assuming equal variances) is flawed - even in the current releases ❝ ❝ Agreeing with D. Labes in the top post I would also use a t-test for unequal variances. That's the default of I see. Thanks again. — 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 |
yjlee168 ★★★ ![]() ![]() Kaohsiung, Taiwan, 2010-04-26 02:09 (5463 d 19:21 ago) @ Helmut Posting: # 5219 Views: 58,022 |
|
Dear Helmut, BTW, may I ask if the analysis of a replicate BE study is acceptable with WNL v5.x or v6.x? WNL uses a mixed effect model, too, to analyze a replicate BE. ❝ D. Labes referred to one of my old posts: WinNonlin's method (assuming equal variances) is flawed - even in the current releases WinNonlin 5.3 and Phoenix/WinNonlin 6.1. — 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, 2010-04-26 03:29 (5463 d 18:01 ago) @ yjlee168 Posting: # 5221 Views: 58,155 |
|
Dear bears, ❝ BTW, may I ask if the analysis of a replicate BE study is acceptable with WNL v5.x or v6.x? WNL uses a mixed effect model, too, to analyze a replicate BE. What do you mean by "acceptable"? — 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, 2010-04-26 10:59 (5463 d 10:31 ago) @ Helmut Posting: # 5228 Views: 57,953 |
|
Dear Helmut, One of bear users found the differences when he compared bear and WNL with his dataset obtained from a replicate BE study. I found that the mixed effect model used in WNL v6.x was different from bear. In WNL, the fixed terms included: int + SEQUENCE + FORMULATION + PERIOD; and the random terms: FORMULATION*SUBJECT + PERIOD*FORMULATION*SUBJECT. I don't know why WNL sets its models like this. In bear, the fixed effects were SEQUENCE + PERIOD + FORMULATION; the random effect was only FORMULATION/SUBJECT. That's why I asked the question. I should search first, like this post of yours... ![]() ❝ What do you mean by "acceptable"? — 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, 2010-04-26 18:15 (5463 d 03:14 ago) @ yjlee168 Posting: # 5236 Views: 58,039 |
|
Dear bears, it's not that easy. To quote from the manual: Replicated crossover designs For replicated crossover designs, the default model used in the Bioequivalence Wizard is the example model given for replicated designs in Appendix E of the FDA guidance: Fixed effects model is:
Appendix E to FDA (2001) states: The following illustrates an example of program statements to run the average BE analysis using PROC MIXED in SAS version 6.12, with SEQ, SUBJ, PER, and TRT identifying sequence, subject, period, and treatment variables, respectively, and Y denoting the response measure (e.g., log(AUC), log(Cmax)) being analyzed:
The Estimate statement assumes that the code for the T formulation precedes the code for the R formulation in sort order (this would be the case, for example, if T were coded as 1 and R were coded as 2). If the R code precedes the T code in sort order, the coefficients in the Estimate statement would be changed to -1 1. In the Random statement, TYPE=FA0(2) could possibly be replaced by TYPE=CSH. This guidance recommends that TYPE=UN not be used, as it could result in an invalid (i.e., not nonnegative definite) estimated covariance matrix. We have already discovered differences between SAS and WinNonlin in the evaluation of replicate designs. ❝ I should search first, like this post of yours... No, that's another cup of tea! I was referring to EMA's guideline asking for ANOVA with fixed effects - which is not clever anyhow. — 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, 2010-04-25 21:34 (5463 d 23:55 ago) @ yjlee168 Posting: # 5214 Views: 58,065 |
|
Dear d_labes, When I revised bear today, I found that the following two models got the same results (with built-in dataset in bear v2.4.2) for CIs. ❝ ❝ Dependent Variable: lnCmax and ❝ lmCmax_ss<- lm(Cmax_ss ~ drug , data=TotalData) Call: Just a quick response. I am studying Helmut's t tests for further revision. — 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 |
ElMaestro ★★★ Denmark, 2010-04-25 22:40 (5463 d 22:50 ago) (edited on 2010-04-25 23:42) @ yjlee168 Posting: # 5215 Views: 58,243 |
|
Hi Bears, ❝ When I revised bear today, I found that the following two models got the same results (...) The results are similar for the fixed effect (here: formulation). The relationship between the lm's residual and the lme's variance components is described above. Now, just to add a little confusion: D_labes pointed out some confusion about the results from the lme, but in my opinion there is also funny stuff going on with the lm: Negative adjusted r squared. Another cosmic mindf#&@er from the realm of statistics. I love it. Best regards EM. PS: Yes, I am aware of the definitions, e.g. Wikipedia. |
Helmut ★★★ ![]() ![]() Vienna, Austria, 2010-04-26 00:38 (5463 d 20:52 ago) @ yjlee168 Posting: # 5216 Views: 58,103 |
|
Dear bears, ❝ When I revised bear today, […] (with built-in dataset in bear v2.4.2) for CIs. Are you trying to confuse me? The built-in dataset consists of 20 (10:10) observations. For comparisons can we please stick to this dataset, lnAUC0t only? subj drug Cmax AUC0t AUC0INF lnCmax lnAUC0t lnAUC0INF For non-bears, here is the dataset (balanced, 20 subjects) for download. With this code # Change to folder containg data files in RGui! I get Welch Two Sample t-test As expected the CI is slightly wider as the ones obtained by simple lm or the strange lme (83.312-123.920). Have a look at the plot. ![]() Edit: Remove the boxplot(lnAUC0t ~ drug, col="lightgray") THX to D. Labes for beta-testing. [Helmut] — 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, 2010-04-26 00:44 (5463 d 20:45 ago) @ Helmut Posting: # 5217 Views: 58,006 |
|
Dear Helmut, In bear v2.4.2, I've changed to dataset for demo in parallel study (see my previous post of this thread). The dataset should be subj drug Cmax AUC0t AUC0INF lnCmax lnAUC0t lnAUC0INF Sorry about this. — 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, 2010-04-26 03:13 (5463 d 18:17 ago) @ yjlee168 Posting: # 5220 Views: 58,151 |
|
Dear bears, well I'm also running v2.4.2 here. I got the 20 subjects dataset from the parallel-demo output 'lme_stat.txt'... — 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, 2010-04-26 10:16 (5463 d 11:14 ago) @ Helmut Posting: # 5226 Views: 58,065 |
|
Dear Helmut, I noticed that d_labes got the same dataset as yours (df = 18 in his post), but he used v2.4.1. I also download bear (v2.4.2) installation file (bear_2.4.2.tar.gz) from one of CRAN ftp sites, and unzip it to view the dataset file (../bear/data/Paralleldata.r) for parallel. It is the new dataste with 27 subjects (test: 14's, ref.: 13's). So I don't know why your dataset was not updated simultaneously when you updated bear to v2.4.2. I'll try to find out what it's going on. Thanks for your message. ❝ well I'm also running v2.4.2 here. I got the 20 subjects data-set from the parallel-demo output 'lme_stat.txt'... — 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, 2010-04-26 15:12 (5463 d 06:18 ago) @ yjlee168 Posting: # 5232 Views: 57,997 |
|
Dear bears, OK, checked it again. Paralleldata.r contains 27 subjects, but the demo works with the old one of 20. Still no idea where bear 2.4.2 gets the data from if I run the parallel design demo. Strange. Only if I run the NCA-demo first, I get the new dataset… — 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, 2010-04-26 20:43 (5463 d 00:47 ago) @ Helmut Posting: # 5240 Views: 58,018 |
|
Dear Helmut, I know what it's going on. You're right about this. When you just do 'Statistical analysis', the parameter values were entered directly from one (demoBANOVA.r) of R-script files, not from a single data file. The data file, Paralleldata.r, is specifically used for the demo purpose from NCA -> Statistical analysis. Nothing's wrong so far. Thank you for your feedback. ❝ works with the old one of 20. Still no idea where bear 2.4.2 gets the data from if I run the parallel design demo. Strange. Only if I run the NCA-demo first, I get the new dataset… — 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 |
yjlee168 ★★★ ![]() ![]() Kaohsiung, Taiwan, 2010-04-26 10:41 (5463 d 10:49 ago) @ Helmut Posting: # 5227 Views: 57,994 |
|
Dear Helmut, ❝ T/R [%] with alpha 0.05 (90% CI) ❝ Point Estimate CL90 lower CL90 upper ❝ Ratio 101.607 82.858 124.598 ❝ ❝ As expected the CI is slightly wider as the ones obtained by simple lm or the strange lme (83.312-123.920). Have a look at the plot. Great. Thank you so much for the comparison. Interesting. — 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 |
d_labes ★★★ Berlin, Germany, 2010-04-26 11:04 (5463 d 10:25 ago) @ Helmut Posting: # 5229 Views: 57,961 |
|
Dear Helmut, ❝ ❝ ❝ > Error in eval(expr, envir, enclos) : object 'yl' not found ❝ Have a look at the plot. A very fine example of hetero-scedasticity and eventually of non-normality ![]() With t-test assuming equal variances one gets: Point Estimate CL90 lower CL90 upper Homework: Compare this to the results of lm() or lme() in this thread ![]() To repeat my question above: Any hint for more then 2 groups? Very seldom for BE studies, I know. But according to Murphy's law I have to deal with a 3-parallel-group design already tomorrow. — Regards, Detlew |
yjlee168 ★★★ ![]() ![]() Kaohsiung, Taiwan, 2010-04-26 11:22 (5463 d 10:08 ago) @ d_labes Posting: # 5230 Views: 58,128 |
|
Dear d_labes, ❝ To repeat my question above: Any hint for more then 2 groups? Are the following Power to know codes feasible (3-group Parallel)? Never try it before myself.
PROC GLM DATA=EXAMPLE; ❝ Very seldom for BE studies, I know. But according to Murphy's law I have to deal with a 3-parallel-group design already tomorrow. — 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 |
d_labes ★★★ Berlin, Germany, 2010-04-26 15:29 (5463 d 06:01 ago) @ yjlee168 Posting: # 5233 Views: 57,880 |
|
Dear Yung-jin, ❝ Are the following Power to know codes feasible (3-group Parallel)? Yesss Sir. But only if we assume equal variances within the groups. I do not have the power to know any way to get unequal variance assumption into Proc GLM. And at least the mighty FDA does not want it this way from us ![]() — Regards, Detlew |
Helmut ★★★ ![]() ![]() Vienna, Austria, 2010-04-26 16:45 (5463 d 04:45 ago) @ d_labes Posting: # 5234 Views: 58,134 |
|
Dear D. Labes and Yung-jin, ❝ Yesss Sir. But only if we assume equal variances within the groups. ❝ I do not have the power to know any way to get unequal variance assumption into Proc GLM. ❝ ❝ And at least the mighty FDA does not want it this way from us FDA’s requirement is the justification for guideline-believers. I think it’s not by chance that FDA calls for procedures for unequal variances if they are available (specifically for parallel groups and replicate designs). Bad luck for 2×2 cross-overs (common variance part of the model). IMHO good statistical practice would call for the Welsh-test; it’s also not by chance that var.equal = FALSE is the default in t.test .— Dif-tor heh smusma 🖖🏼 Довге життя Україна! ![]() Helmut Schütz ![]() The quality of responses received is directly proportional to the quality of the question asked. 🚮 Science Quotes |
d_labes ★★★ Berlin, Germany, 2010-04-26 17:58 (5463 d 03:32 ago) @ Helmut Posting: # 5235 Views: 57,954 |
|
Dear Helmut, I thought love was only true in fairy tales ❝ FDA’s requirement is the justification for guideline-believers. Thanks for this 'nom du guerre' ![]() ❝ IMHO good statistical practice would call for the Welsh-test ![]() Best regards, yours respectfully Guideline-Believer |
Helmut ★★★ ![]() ![]() Vienna, Austria, 2010-04-26 18:31 (5463 d 02:59 ago) @ d_labes Posting: # 5237 Views: 57,918 |
|
Dear D. Labes, THX for bringing this song back to my memory (German: schlimmer Ohrwurm). ❝ ❝ FDA’s requirement is the justification for guideline-believers. ❝ Thanks for this 'nom du guerre' Well, of course I didn't mean you by that. Only a hint for people too lazy to go beyond guidelines. ![]() ❝ ❝ IMHO good statistical practice would call for the Welsh-test ❝ OK, if you like: Welch, Satterthwaite, Aspin-Welch, Howe, Milliken-Johnson… A warning for M$-Excel users: TTEST(matrix1;matrix2;2;3) for unequal variances uses a crude method, i.e., down-rounded integer degrees of freedom. Another reason to avoid this piece. — Dif-tor heh smusma 🖖🏼 Довге життя Україна! ![]() Helmut Schütz ![]() The quality of responses received is directly proportional to the quality of the question asked. 🚮 Science Quotes |
Helmut ★★★ ![]() ![]() Vienna, Austria, 2010-04-26 14:55 (5463 d 06:34 ago) @ d_labes Posting: # 5231 Views: 58,129 |
|
Dear D. Labes, ❝ ❝ ❝ Ooops: Shit! Of course instead of boxplot(lnAUC0t ~ drug, col="lightgray" use boxplot(lnAUC0t ~ drug, col="lightgray") ❝ A very fine example of hetero-scedasticity and eventually of non-normality Maybe. But we are not allowed to test that anyhow. ![]() For non-bears, here is the dataset (imbalanced, 27 subjects) for download. ❝ With t-test assuming equal variances one gets: ❝ ❝ Ratio 101.61 83.31 123.92 ❝ ❝ Homework: Compare this to the results of lm() or lme() in this thread ❝ Yes, sure. What else? That's why we should avoid it. ❝ To repeat my question above: Any hint for more then 2 groups? ❝ Very seldom for BE studies, I know. But according to Murphy's law I have to deal with a 3-parallel-group design already tomorrow. I went through the literature last week and did not come to a conclusion yet. Essentially there are two approaches:
Moser BK, Stevens GR. Homogeneity of variance in the two-sample means test. Amer Statist. 1992;46:19-21. Depending on the study’s target I would consider a Bonferroni-adjustment (that’s even the original application: independent tests). — Dif-tor heh smusma 🖖🏼 Довге життя Україна! ![]() Helmut Schütz ![]() The quality of responses received is directly proportional to the quality of the question asked. 🚮 Science Quotes |
d_labes ★★★ Berlin, Germany, 2010-04-26 18:36 (5463 d 02:54 ago) @ Helmut Posting: # 5238 Views: 58,235 |
|
Dear Helmut, ❝ ... I would go with Welch-tests, because ANOVA (or lm and lme) assume ❝ homoscedasticity. What about: require(nlme) # HS: added, because not loaded by default This gives (20 subjects bear data) : Generalized least squares fit by REML But astonishing ![]() intervals(glsModel, level=0.9) — Regards, Detlew |
Helmut ★★★ ![]() ![]() Vienna, Austria, 2010-04-26 19:00 (5463 d 02:30 ago) @ d_labes Posting: # 5239 Views: 58,043 |
|
Dear D. Labes, ❝ But astonishing: ❝ #back-transformed ❝ Very strange... — Dif-tor heh smusma 🖖🏼 Довге життя Україна! ![]() Helmut Schütz ![]() The quality of responses received is directly proportional to the quality of the question asked. 🚮 Science Quotes |
Helmut ★★★ ![]() ![]() Vienna, Austria, 2010-04-27 03:36 (5462 d 17:53 ago) @ d_labes Posting: # 5242 Views: 57,861 |
|
Dear D. Labes, you have already outed yourself as a passionate wheel-reinventer, but why don't you simply go with the Welch-test (orwhatsover for unequal variances)? Since our Capt'n luuuvs simulations, I recycled some of his code to play width: sims <- 10000 — Dif-tor heh smusma 🖖🏼 Довге життя Україна! ![]() Helmut Schütz ![]() The quality of responses received is directly proportional to the quality of the question asked. 🚮 Science Quotes |
d_labes ★★★ Berlin, Germany, 2010-04-28 12:58 (5461 d 08:32 ago) @ Helmut Posting: # 5253 Views: 58,351 |
|
Dear Helmut, ----- Sandwich ----- ❝ you have already outed yourself as a passionate wheel-reinventer, but why don't you simply go with the Welch-test (orwhatsover for unequal variances)? To cite myself near the beginning of this thread: "I would go for a parallel groups study with exactly 2 groups with the 'simple' t-test (Welch variant ...)". Simple was here meant with respect to the lme() model used in bear. But I'm seeking for something that can be generalized easily to more then 2 groups. Pairwise tests I'm not so happy with. Eventually this (recently discovered) could be a way: Herberich E, Sikorski J, Hothorn T (2010) "A Robust Procedure for Comparing Multiple Means under Heteroscedasticity in Unbalanced Designs" PLoS ONE 5(3): e9788. doi:10.1371/journal.pone.0009788 online resource Easy to implement in R, only a couple of code lines. But I was not a sandwich gourmet up to now ![]() ----- Simsalabim ----- <nitpicking> ❝ ... ❝ lnPKT <- rnorm(n=nT,mean=MeanT,sd=CVT*MeanT) ❝ lnPKR <- rnorm(n=nR,mean=MeanR,sd=CVR*MeanR) ❝ ... ![]() If you are really interested in dealing with log-transformed metrics as lnPK suggests ![]() # short hand function Of course this will not affect the comparison between t-test with equal variances and Welch t-test I think. </nitpicking> — Regards, Detlew |
Helmut ★★★ ![]() ![]() Vienna, Austria, 2010-04-28 16:19 (5461 d 05:11 ago) @ d_labes Posting: # 5257 Views: 57,966 |
|
Dear D. Labes! ❝ But I'm seeking for something that can be generalized easily to more then 2 groups. Pairwise tests I'm not so happy with. OK. Interesting reference, although the word "robust" in the title may trigger the non-parametric-panic-reflex in some regulators. ![]() Of course you are right about rlnorm(…) - quick and dirty as always.— Dif-tor heh smusma 🖖🏼 Довге життя Україна! ![]() Helmut Schütz ![]() The quality of responses received is directly proportional to the quality of the question asked. 🚮 Science Quotes |
martin ★★ Austria, 2010-05-02 20:22 (5457 d 01:07 ago) @ d_labes Posting: # 5272 Views: 58,548 |
|
dear d_labes! I just want to draw your attention to the parametrization of R function rlnorm . When you want to generate log-normal distributed random variables with a given mean and CV on the observed scale - I suggest to use meanlog=log(mean)-0.5*log(1+cv^2) instead of meanlog=log(mean) . # example best regards martin |
d_labes ★★★ Berlin, Germany, 2010-05-03 18:22 (5456 d 03:08 ago) @ martin Posting: # 5276 Views: 57,821 |
|
dear martin! ❝ ... When you want to generate log-normal distributed random variables with a given mean and CV on the observed scale - I suggest to use Thanks for clarifying this. — Regards, Detlew |
ElMaestro ★★★ Denmark, 2013-07-26 23:42 (4275 d 21:48 ago) @ martin Posting: # 11065 Views: 49,321 |
|
Hi Martin and all, Sorry to embark on archaelogy. ❝ When you want to generate log-normal distributed random variables with a given mean and CV on the observed scale - I suggest to use ❝ ❝ ❝ ❝ ❝ ❝ ❝ ❝ ❝ ❝ ❝ ❝ Well.... Is that really something anyone wants to do? When we simulate BE, like in crossover trials, we most likely want to simulate with a known geometric mean ratio on the observed scale and a known CV on the observed scale. I could have misunderstood rlnorm entirely, but otherwise: GeoMean=function(a) Stuff like that really hurts. I would any day prefer to use rnorm to avoid the confusion:logTRratios=rnorm(n=1e6, mean=log(0.95), sd=sqrt(log(1+cv^2))) Let me add that for those who simulate Test and Ref data individually (yes, there are still backward people who do that ![]() 0.5*log(1+cv^2) will cancel out as long as a common variance term is used and balance is present because log(T)-log(R)=log(T/R).— Pass or fail! ElMaestro |
Helmut ★★★ ![]() ![]() Vienna, Austria, 2013-07-28 04:01 (4274 d 17:29 ago) @ ElMaestro Posting: # 11081 Views: 49,053 |
|
Hi ElMaestro & Martin, ❝ Sorry to embark on archaelogy. Great. Comes handy for some TSD sim’s I’m currently running! meang <- function(z) { exp(mean(log(na.omit(z)))) } ![]() a. mean %RE a. mean CV %RE CV g. mean %RE g. mean Or alternatively: boxplot(log(x), log(y), ylab="log(x, y)", ![]() Sometimes help(rlnorm) :The log normal distribution has density $$\small{f(x)=\frac{1}{\sqrt{2\pi}\sigma x}\exp (-\frac{(\log_{e}x - \mu)^2}{2 \sigma^2})}$$ where \(\small{\mu}\) and \(\small{\sigma}\) are the mean and standard deviation of the logarithm. The mean is \(\small{E(X) = \exp(\mu + \frac{1}{2}\sigma^2)}\), the median is \(\small{med(X) = \exp(\mu)}\), and the variance \(\small{Var(X) = \exp(2\mu+\sigma^2)\exp(\sigma^2-1)}\) and hence the coefficient of variation is \(\small{\sqrt{\exp(\sigma^2)-1}}\) […]. How I love the word “hence”. Note that the maximum is located at \(\small{mode(X)=\exp(\mu-\sigma^2)}\). — Dif-tor heh smusma 🖖🏼 Довге життя Україна! ![]() Helmut Schütz ![]() The quality of responses received is directly proportional to the quality of the question asked. 🚮 Science Quotes |