Huge gap in my understanding [General Sta­tis­tics]

posted by martin  – Austria, 2018-03-06 15:40 (2232 d 19:23 ago) – Posting: # 18498
Views: 4,813

Dear ElMaestro,

You may have a look at R package lsmeans for more details and this R code may help (credits to Alex) in understanding.

library(lsmeans)

### Covariance example (from Montgomery Design (8th ed.), p.656)
print(fiber)

### model
fiber.lm <- lm(strength ~ diameter + machine, data = fiber)
summary(fiber.lm)

# means versus ls-means
fiber$pred <- predict(fiber.lm, list(machine=fiber$machine, diameter=rep(mean(fiber$diameter), 15)))
aggregate(fiber$strength, by=list(fiber$machine), mean) # mean
aggregate(fiber$pred, by=list(fiber$machine), mean)     # lsmean

# lsmeans via R package lsmeans
fiber.lsm <- lsmeans(fiber.lm, "machine")
fiber.lsm

Complete thread:

UA Flag
Activity
 Admin contact
22,984 posts in 4,822 threads, 1,649 registered users;
44 visitors (0 registered, 44 guests [including 2 identified bots]).
Forum time: 12:03 CEST (Europe/Vienna)

You can’t fix by analysis
what you bungled by design.    Richard J. Light, Judith D. Singer, John B. Willett

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