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

posted by yjlee168 Homepage – Kaohsiung, Taiwan, 2009-05-23 21:30 (6232 d 01:43 ago) – Posting: # 3739
Views: 13,922

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,654 posts in 4,992 threads, 1,571 registered users;
126 visitors (0 registered, 126 guests [including 16 identified bots]).
Forum time: 23:14 CEST (Europe/Vienna)

The idea is to try and give all the information to help others
to judge the value of your contribution;
not just the information that leads to judgment
in one particular direction or another.    Richard Feynman

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