
Last chance! 50% off unlimited learning
Sale ends in
ref.grid
or lsmobj
objectsref.grid
or lsmobj
contain several settings in their "misc"
slot that affect primarily the
defaults used by summary
. This update
method allows them to be changed more safely than by modifying this slot directly.
In addition, the user may set defaults for all objects using options(lsmeans = ...), or more conveniently using the lsm.options
function documented here.## S3 method for class 'ref.grid':
update(object, ...)
lsm.options(...)
ref.grid
(or its extension, lsmobj
)update
returns a copy of object
with its "misc"
slot modified. lsm.options
returns the current options (same as the result of getOption("lsmeans")).update
, the names in ...
are partially matched against those that are valid, and if a match is found, it adds or replaces the current setting. The valid names are
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
In lsm.options
, we may set or change the default values for the above attributes in the lsmeans
option list(see options
). Currently, the following elements of this list are used if specified:
[object Object],[object Object],[object Object],[object Object]summary
# An altered log transformation
warp.lm1 <- lm(log(breaks + 1) ~ wool*tension, data = warpbreaks)
rg1 <- update(ref.grid(warp.lm1),
tran = list(linkinv = function(eta) exp(eta) - 1,
mu.eta = function(eta) exp(eta)),
inv.lbl = "pred.breaks")
summary(rg1, type = "response")
lsm.options(ref.grid = list(level = .90),
contrast = list(infer = c(TRUE,FALSE)),
estble.tol = 1e-6)
# Sets default confidence level to .90 for objects created by ref.grid
# AS WELL AS lsmeans called with a model object (since it creates a
# reference grid). In addition, when we call 'contrast', 'pairs', etc.,
# confidence intervals rather than tests are displayed by default.
lsm.options(disable.pbkrtest = TRUE)
# This forces use of asymptotic methods for lmerMod objects.
# Set to FALSE or NULL to re-enable using pbkrtest.
print(lsm.options()) # see the current settings
Run the code above in your browser using DataLab