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

posted by martin  – Austria, 2018-03-06 15:40 (1849 d 17:23 ago) – Posting: # 18498
Views: 4,466

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.


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

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

# 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")

Complete thread:

UA Flag
 Admin contact
22,557 posts in 4,724 threads, 1,608 registered users;
26 visitors (0 registered, 26 guests [including 12 identified bots]).
Forum time: 10:03 CEST (Europe/Vienna)

A scientist’s aim in a discussion with his colleagues
is not to persuade, but to clarify.    Leo Szilard

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