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

posted by yjlee168 Homepage – Kaohsiung, Taiwan, 2009-05-23 21:30 (5873 d 08:12 ago) – Posting: # 3739
Views: 11,624

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,672 registered users;
45 visitors (0 registered, 45 guests [including 14 identified bots]).
Forum time: 05:42 CEST (Europe/Vienna)

Medical researches can be divided into two sorts:
those who think that meta is better and those
who believe that pooling is fooling.    Stephen Senn

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