Learn R Programming

emmeans (version 1.10.4)

mvregrid: Multivariate regridding

Description

This function is similar to regrid except it performs a multivariate transformation. This is useful, for instance, in multivariate models that have a compositional response.

Usage

mvregrid(object, newname = "component", newlevs = seq_len(ncol(newy)),
  mult.name = names(levels)[length(levels)], fcn = paste0(tran, "Inv"),
  ...)

Value

A new emmGrid object with the newly created factor as its last factor

Arguments

object

An emmGrid object

newname

The name to give to the newly created multivariate factor

newlevs

Character levels of the newly created factor (must conform to the number of columns created by fcn)

mult.name

The name of the multivariate factor to be transformed. By default, we use the last factor

fcn

The multivariate function to apply. If character, we look for it in the namespace of the compositions package.

...

Additional arguments passed to fcn

Details

If a multivariate response transformation was used in fitting the model, its name is auto-detected, and in that case we need not specify fcn as long as its inverse can be found in the namespace of the compositions package. (That package need not be installed unless fcn is a character value.) For some such models, auto-detection process throws a warning message, especially if cbind is also present in the model formula.

Currently, no bias-adjustment option is available.

Examples

Run this code
if(requireNamespace("compositions"))
    emm_example("mvregrid")
    # Use emm_example("mvregrid", list = TRUE) # to see just the code

Run the code above in your browser using DataLab