Learn R Programming

lsmeans (version 2.10)

update: Set options for ref.grid or lsmobj objects

Description

Objects of class ref.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.

Usage

## S3 method for class 'ref.grid':
update(object, ...)

lsm.options(...)

Arguments

object
An object of class ref.grid (or its extension, lsmobj)
...
Arguments specifying elements' names and their new values.

Value

  • update returns a copy of object with its "misc" slot modified. lsm.options returns the current options (same as the result of getOption("lsmeans")).

Details

In 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]

See Also

summary

Examples

Run this code
# 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