lsmeans for mixed model in R [🇷 for BE/BA]

posted by yjlee168 Homepage – Kaohsiung, Taiwan, 2015-04-20 01:36 (4075 d 22:42 ago) – Posting: # 14709
Views: 32,730

Dear Helmut and Elmaestro,

I also tried some other methods. I used two R packages lsmeans and lmerTest to do analysis of mixed model first.
if I used lmerTest (also required package pbkrtest),
modlnCmax<-lmer(log(Cmax) ~ seq +  prd + drug + (1|subj), data=TotalData, REML=TRUE)
lsm_lnCmax<-lsmeans(modlnCmax,test.effs="drug") ### for lmerTest, or
lsm_lnCmax<-lsmeans(modlnCmax,"drug")           ### for lsmeans
I got the results as
Least Squares Means table:
        seq prd drug Estimate Standard Error   DF t-value Lower CI Upper CI p-value   
drug  1  NA  NA  1.0   7.3633         0.0273 19.4     270     7.31     7.42  <2e-16 ***
drug  2  NA  NA  2.0   7.4098         0.0273 19.4     272     7.35     7.47  <2e-16 ***


If I used lsmeans package, I got
drug   lsmean         SE    df lower.CL upper.CL
 1    7.363255 0.02726719 19.38 7.306260 7.420250
 2    7.409809 0.02726719 19.38 7.352813 7.466804

Results are averaged over the levels of: seq, prd
Confidence level used: 0.95

Original results from bear are
  summary  Test   Ref Ratio
1  LSMEAN 7.411 7.365 1.006
2    S.D. 0.106 0.120 0.020
3  C.V(%) 1.424 1.633 1.992


Both lsmeans and lmerTest only work with lmer(), not lme(). What do you think about these results? I'm :confused:.

Ref. link: detlew's The SAS way in Rrrr land

❝ ...

                                  R        T

❝ Method A (EMA, subjects fixed)   7.328141 7.391880

❝ Method B (EMA, subjects random)  7.328141 7.391880

❝ Method C (FDA = mixed efects)    7.328141 7.391880

❝ Marginal means (Gnumeric)        7.328141 7.391880

❝ So why do we get…

bear                             7.356274 7.420013

❝ … which are ~3.8% higher for both treatments? No, I’m not satisfied if only the PE agrees – I expect to get a nasty surprise once we start to deal with un­ba­lanced data.


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
Thread locked

Complete thread:

UA Flag
Activity
 Admin contact
23,654 posts in 4,992 threads, 1,571 registered users;
116 visitors (0 registered, 116 guests [including 11 identified bots]).
Forum time: 00:18 CEST (Europe/Vienna)

Always listen to experts.
They’ll tell you what can’t be done and why.
Then do it.    Robert A. Heinlein

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