Weidson ☆ Brazil, 2021-12-30 22:16 (1210 d 02:10 ago) Posting: # 22720 Views: 5,315 |
|
Dear friends, By studying the replicateBE package documentation https://github.com/Helmut01/replicateBE#readme I was able to verify that the method.A and method.B functions (package replicateBE) are derived from the functions lm and lme (packages stats and nlme). If possible I would like to reproduce the same ANOVA tables that are displayed in the output of the methods.A and method.B using only the lm and lme functions as indicated in the instructions. Unfortunately I am not reaching my goal of obtain the same results as expected ![]() Somebody can help me? I Would like publish at forum my data set that generates this results however I didn't see option for upload files excel (just figures). Is it possible publish excel files? If yes, How? R Code 1.0 method.A with IPC_Drug.Cmax Data Set method.A(path.in = path, path.out = path, file = paste0(fn, ".", "Cmax"), ext = "csv", na = "NA", sep = sep, dec = dec, ola = TRUE, print = TRUE, verbose = TRUE, ask = TRUE, plot.bxp = TRUE) ANOVA Outputs for R Code 1.0: Data set IPC_Drug.Cmax: Method A by lm() R Code 1.1 Obtain ANOVA by lm() function with DS_Cmax Data Set library(stats) ANOVA Outputs for R Code 1.1: Analysis of Variance Table R Code 2.0 method.B with IPC_Drug.Cmax Data Set method.B(path.in = path, path.out = path, file = paste0(fn, ".", "Cmax"), ext = "csv", na = "NA", sep = sep, dec = dec, ola = TRUE, print = TRUE, verbose = TRUE, ask = TRUE, plot.bxp = TRUE) ANOVA Outps for utR Code 2.0: Data set IPC_Drug.Cmax: Method B (option = 2) by lme() R Code 2.1 Obtain ANOVA by lme() function with DS_Cmax Data Set library(nlme) ANOVA Outputs for R Code 2.1: numDF denDF F-value p-value |
Helmut ★★★ ![]() ![]() Vienna, Austria, 2021-12-30 22:23 (1210 d 02:03 ago) @ Weidson Posting: # 22721 Views: 4,539 |
|
Hi Weidson, ❝ […] I didn't see option for upload files excel (just figures). Correct. ❝ Is it possible publish excel files? If yes, How? No. Email them to me and I will upload them together with a link for other users. — Dif-tor heh smusma 🖖🏼 Довге життя Україна! ![]() Helmut Schütz ![]() The quality of responses received is directly proportional to the quality of the question asked. 🚮 Science Quotes |
Weidson ☆ Brazil, 2021-12-30 22:43 (1210 d 01:44 ago) @ Helmut Posting: # 22722 Views: 4,529 |
|
Hi Helmut Thank you very much for the quick reply!!! I will send for you now. Weidson |
Helmut ★★★ ![]() ![]() Vienna, Austria, 2021-12-31 00:45 (1209 d 23:41 ago) @ Weidson Posting: # 22723 Views: 4,675 |
|
Hi Weidson and others who want to give it a try… Download and save to a suitable folder. Depending on your operating system, browser, and localization possibly you will be asked to open the file in Excel or another spreadsheet. Don’t. Just save it. Then:
With method.A(...) you should get in the console:
And with method.B(...) :
The point estimates $$\small{100\,\exp(-0.238037)\approx78.81735\%\;vs\;100\,\exp(-0.23804)\approx78.81712\%}$$ and standard errors (\(\small{0.104971\;vs\;0.104970}\)) are very similar because the data set is complete (no missing periods). Results are identical after rounding acc. to the guidelines (see mine for Method A and Method B). You don’t need library(stats) because it is attached by default.Try print(sessionInfo(), locale = FALSE) . I got after startup:
Reproducing your results:
Here lm() is left out in the rain because we have only a simple data frame. The degrees of freedom and Mean Squares are wrong. Therefore, we need to factorize effects:
Sequence is tested against Residuals . Now change to the correct test:
replicateBE method.A() provides.Two more comments:
![]() aov() instead of anova() , showing in an additional line if effects are not estimable.
Sequence ) the MSE of Period, and Treatment and the Residual Error are identical. Hence, you will get the same PE and its CI…— Dif-tor heh smusma 🖖🏼 Довге життя Україна! ![]() Helmut Schütz ![]() The quality of responses received is directly proportional to the quality of the question asked. 🚮 Science Quotes |
mittyri ★★ Russia, 2022-01-01 12:50 (1208 d 11:37 ago) @ Helmut Posting: # 22724 Views: 4,374 |
|
Hi Helmut, ❝ see there and how to get a Type III ANOVA in just a little reminder: as it is shown here, if Subject(Sequence) term is placed in Variance Structure tab (not in Fixed effects tab) as it is done by default, Partial SS will give SSIII table, additional Test Nom/Denom is not required — Kind regards, Mittyri |
Helmut ★★★ ![]() ![]() Vienna, Austria, 2022-01-01 22:52 (1208 d 01:35 ago) @ mittyri Posting: # 22725 Views: 4,404 |
|
Hi mittyri, ❝ just a little reminder: as it is shown here, if Subject(Sequence) term is placed in Variance Structure tab (not in Fixed effects tab) as it is done by default, Partial SS will give SSIII table, additional Test Nom/Denom is not required Correct, of course. ![]() As I wrote above … ❝ ❝ Note also that in … same in the replicateBE , function method.B() .— Dif-tor heh smusma 🖖🏼 Довге життя Україна! ![]() Helmut Schütz ![]() The quality of responses received is directly proportional to the quality of the question asked. 🚮 Science Quotes |
Weidson ☆ Brazil, 2022-01-02 15:51 (1207 d 08:36 ago) @ Helmut Posting: # 22726 Views: 4,438 |
|
Helmut, Thank you very much for answer!!! It was very complete!!! ![]() please, look the ANOVA table results that was generate by proposed code (no changes were made with the sequence effect): ❝ attr(TypeIII, "heading")[1] <- "Type III Analysis of Variance Table\n" ❝ MSdenom <- TypeIII["sequence:subject", "Mean Sq"] ❝ df2 <- TypeIII["sequence:subject", "Df"] ❝ fvalue <- TypeIII["sequence", "Mean Sq"] / MSdenom ❝ df1 <- TypeIII["sequence", "Df"] ❝ TypeIII["sequence", 4] <- fvalue ❝ TypeIII["sequence", 5] <- pf(fvalue, df1, df2, lower.tail = FALSE) ❝ print(TypeIII, digits = 6, signif.stars = FALSE) ❝ ❝ Analysis of Variance Table So I made a small modification in your code: Fit_1 <- lm(log(Cmax) ~ Sequence + Subject%in%Sequence + Period + Treatment , data=Cmax) And here, the new results ######################################################################### One last doubt: How can we include at function lme() a term for carryover first-order effect (keeping the sequence effect in the model)? We have many DF for estimate this effect, so I presume that it can be estimated to replicate designs as this our example!!! How and how many columns should we have in the dataset to estimate the first-order carryover effect? This test can be useful when we are working with auto-inducers drugs (I read your article and I like very much). At Phoenix WinNonlin this can be make creating two collumns named "Carry" and "Over". The collumn "Carry" is composed by 0 (if data of period 1) or 1 (if data period 2,3,4 ...). You should define "Carry" as covariate and "Over" as Classification. The collumn "Over" indicates which treatment was administered in the previous period. The fixed model: Sequence+Treatment+Period+Carry*over. The specification for random effects that I use is the same oriented by FDA for replicate design (Repeted specification=Period, Variance Bloking Variable=Subject, Group=Treatment (Type=Variance components), Random effects model=Treatment, Variance blocking Variables=Subject (Type=Banded No-Diagonal Factor Analytic f=2) ![]() How would be this parametrization at function lme at R software? ![]() |
Helmut ★★★ ![]() ![]() Vienna, Austria, 2022-01-02 16:49 (1207 d 07:37 ago) @ Weidson Posting: # 22727 Views: 4,400 |
|
Hi Weidson, ❝ Thank you very much for answer!!! Welcome. ❝ It was very complete!!! No, it wasn’t. Just realized that I worked with the source-code of method.A() , where the columns are in lower case (and not in upper case like in your data set). Corrected in my post above. Sorry.❝ And here, the new results ❝ ❝ ❝ Type III Analysis of Variance Table ❝ ❝ Response: log(Cmax) ❝ Sequence 1 1.3253 1.32531 0.27224 0.604233 ❝ Period 3 3.5824 1.19413 2.19909 0.090673 . ❝ Treatment 1 2.7923 2.79228 5.14222 0.024818 * ❝ Sequence:Subject 48 233.6721 4.86817 8.96514 < 2e-16 *** ❝ Residuals 146 79.2796 0.54301 ❝ --- ❝ Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Perfect. ❝ One last doubt: How can we include at function lme() a term for carryover first-order effect (keeping the sequence effect in the model)? We have many DF for estimate this effect, so I presume that it can be estimated to replicate designs as this our example!!! How and how many columns should we have in the dataset to estimate the first-order carryover effect? Please forget carryover. ❝ This test can be useful when we are working with auto-inducers drugs (I read your article and I like very much). Nope. See there again and think about the carbamazepine example.* I had a straightforward induction model behind, i.e., \(\small{\textrm{I}(t)=1\,(-\exp(-\alpha\cdot t)\,)}\). With \(\small{\alpha=1}\) we have practically complete induction (99.48%) on day 5 (Clearance going from 1.35 down to 5.84). Clearly that’s nonlinear and even if we would manage to introduce 1st, 2nd, nth-order carryover in the model, it has no relationship to the real world. ❝ At Phoenix WinNonlin this can be make creating two collumns named "Carry" and "Over". […] Never did that and never will. ![]() ❝ How would be this parametrization at function lme at R software? No idea.
— Dif-tor heh smusma 🖖🏼 Довге життя Україна! ![]() Helmut Schütz ![]() The quality of responses received is directly proportional to the quality of the question asked. 🚮 Science Quotes |