ref.grid: Create a reference grid from a fitted model

Description Usage Arguments Value Author(s) Examples

View source: R/ref.grid.R

Description

These functions are provided in lsmeans because they have been renamed in emmeans

Usage

1
2
3
4
ref.grid(object, ...)
    
recover.data(object, ...)
lsm.basis(object, ...)

Arguments

object

A model object in a supported class.

...

Additional arguments passed to companion functions in the emmeans package.

Value

lsmeans now passes all its computations to emmeans, and the return values are thus what is returned by the corresponding functions ref_grid, recover_data, and emm_basis, respectively.

Author(s)

Russell V. Lenth

Examples

1
2
3
4
5
6
7
8
  fiber.lm <- lm(strength ~ machine + diameter, data = fiber)
  rg <- ref.grid(fiber.lm, at = list(diameter = c(20, 24, 28)))
  rg
  
  # Note this is an emmGrid object defined in emmeans. The old "ref.grid"
  # class is now an extension of this:
  r.g. <- new("ref.grid", rg)
  lsmeans(r.g., "machine")

Example output

Loading required package: emmeans
The 'lsmeans' package is now basically a front end for 'emmeans'.
Users are encouraged to switch the rest of the way.
See help('transition') for more information, including how to
convert old 'lsmeans' objects and scripts to work with 'emmeans'.
'emmGrid' object with variables:
    machine = A, B, C
    diameter = 20, 24, 28
 machine   lsmean        SE df lower.CL upper.CL
 A       40.25521 0.7263363 11 38.65656 41.85387
 B       41.29202 0.7489075 11 39.64369 42.94036
 C       38.67117 0.7815429 11 36.95100 40.39133

Results are averaged over the levels of: diameter 
Confidence level used: 0.95 

lsmeans documentation built on May 2, 2019, 2:02 p.m.