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

posted by yjlee168 Homepage – Kaohsiung, Taiwan, 2009-05-23 21:30 (6225 d 18:39 ago) – Posting: # 3739
Views: 13,904

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.6:- 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,653 posts in 4,991 threads, 1,570 registered users;
150 visitors (0 registered, 150 guests [including 17 identified bots]).
Forum time: 16:09 CEST (Europe/Vienna)

The epistemological value of probability theory is based on the fact
that chance phenomena, considered collectively and on a grand scale,
create non-random regularity.    Andrey Kolmogorov

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