Mean as intercept; model matrices [🇷 for BE/BA]

posted by yjlee168 Homepage – Kaohsiung, Taiwan, 2009-05-23 21:30 (5869 d 18:34 ago) – Posting: # 3739
Views: 11,609

Dear ElMaestro,

We have tested R codes of your examples with SAS. And SAS comes out the correct answer with intercept equal to the mean. So we have been thinking what it is going wrong with R. Finally, we find that if we change the codes of dummy variables as follows:

Per = as.factor(c(1,1,1,1,1,1,1,2,2,2,2,2,2,2)) to

Per = as.factor(c(1,1,1,1,1,1,1,0,0,0,0,0,0,0))

Seq = as.factor(c(1,1,1,1,2,2,2,1,1,1,1,2,2,2)) to

Seq = as.factor(c(1,1,1,1,0,0,0,1,1,1,1,0,0,0))

Trt = as.factor(c(1,1,1,1,2,2,2,2,2,2,2,1,1,1)) to

Trt = as.factor(c(1,1,1,1,0,0,0,0,0,0,0,1,1,1))

Then R and SAS have the same results. Apparently, R has somewhat different from SAS in dealing with lm(), or even with many others... There must be a term in statistics to describe this difference. We just don't know the term yet. However, it becomes more and more interesting now...

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

Complete thread:

UA Flag
Activity
 Admin contact
23,424 posts in 4,927 threads, 1,671 registered users;
24 visitors (0 registered, 24 guests [including 18 identified bots]).
Forum time: 16:04 CEST (Europe/Vienna)

Truth and clarity are complementary.    Niels Bohr

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