bear v1.0.0 - a data analytical tool for ABE in R [🇷 for BE/BA]

posted by yjlee168 Homepage – Kaohsiung, Taiwan, 2008-09-25 00:00 (5686 d 01:12 ago) – Posting: # 2396
Views: 55,743

Dear EM,

Thanks for your comments. We went back to test glm in bear again. And find that you're correct about glm. Basically, both lm and glm generate the same results with the tested dataset. The following are the Type I SS and Type III SS obtained from lm and glm.

lm - Type I SS
glmData <-lm(Cmax ~ sequence+ period + drug +subject, data=KK)
anova(glmData)

Analysis of Variance Table

Response: Cmax
          Df Sum Sq Mean Sq F value Pr(>F)
sequence   1    585     585  0.0160 0.9014
period     1  63175   63175  1.7293 0.2131
drug       1  58149   58149  1.5917 0.2311
subject   12 634325   52860  1.4469 0.2660
Residuals 12 438395   36533


lm - Type III SS
drop1(glmData, test="F")

Single term deletions

Model:
Cmax ~ sequence + period + drug + subject
         Df  Sum of Sq     RSS     AIC F value  Pr(F)
<none>                  438395     302               
sequence  0 -4.657e-10  438395     302               
period    1      63175  501570     304  1.7293 0.2131
drug      1      58149  496544     304  1.5917 0.2311
subject  12     634325 1072719     303  1.4469 0.2660   


glm - Type I SS
glmData <-glm(Cmax ~ sequence+ period + drug +subject, data=KK)
anova(glmData)

Analysis of Deviance Table

Model: gaussian, link: identity

Response: Cmax

Terms added sequentially (first to last)


         Df Deviance Resid. Df Resid. Dev
NULL                        27    1194629
sequence  1      585        26    1194044
period    1    63175        25    1130869
drug      1    58149        24    1072719
subject  12   634325        12     438395


glm - Type III SS
drop1(glmData, test="F")
Single term deletions

Model:
Cmax ~ sequence + period + drug + subject
         Df Deviance     AIC F value  Pr(F)
<none>        438395     384               
sequence  0   438395     384               
period    1   501570     386  1.7293 0.2131
drug      1   496544     385  1.5917 0.2311
subject  12  1072719     385  1.4469 0.2660


Look like that only AICs are different when comparing these two methods.
Since SAS does not calculate AICs in its output, we thus cannot compare which one is correct. The reason we chose lm, instead of glm, might be that the output generated by lm is more like to that of SAS. And we didn't quite understand what "Deviance Resid." (in glm output) meant at beginning.
Again, both glm and lm generate almost the same results.

All the best,
-- Yung-jin Lee
bear v2.9.1:- created by Hsin-ya Lee & Yung-jin Lee
Kaohsiung, Taiwan https://www.pkpd168.com/bear
Download link (updated) -> here
Thread locked

Complete thread:

UA Flag
Activity
 Admin contact
22,988 posts in 4,825 threads, 1,654 registered users;
106 visitors (0 registered, 106 guests [including 3 identified bots]).
Forum time: 01:13 CEST (Europe/Vienna)

The only way to comprehend what mathematicians mean by Infinity
is to contemplate the extent of human stupidity.    Voltaire

The Bioequivalence and Bioavailability Forum is hosted by
BEBAC Ing. Helmut Schütz
HTML5