% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/multiv.R
\name{mvregrid}
\alias{mvregrid}
\title{Multivariate regridding}
\usage{
mvregrid(object, transform = "response", mult.name, newname = mult.name,
  newlevs, fcn, ...)
}
\arguments{
\item{object}{An \code{emmGrid} object}

\item{transform}{The transformation to use in re-gridding. If \code{"response"},
we apply the inverse of the multivariate transformation in \code{object@misc$tran};
otherwise, we re-grid as if \code{transform} had been applied to the multivariate
response. (Note that this will entail first re-gridding to the response scale
if necessary.)}

\item{mult.name}{The name of the multivariate factor to be transformed.
If missing, we use \code{object@roles$multresp}, and throw an error message 
if it is \code{NULL} or ambiguous; in that case, the user must repeat the
call with \code{mult.name} specified.}

\item{newname}{the name to be given to the newly transformed variable}

\item{newlevs}{levels of the newly created factor (must conform to
the number of columns created by \code{fcn}). If missing, we use the column names
of the newly created variable.}

\item{fcn}{The multivariate function to apply. If character, we look for it 
in the namespace of the \pkg{compositions} package.}

\item{...}{Additional arguments passed to \code{fcn}}
}
\value{
A new \code{emmGrid} object with the newly created factor as its last factor
}
\description{
This function is similar to \code{\link{regrid}} except it performs a
multivariate transformation. This is useful, for instance, in multivariate
models that have a compositional response.
}
\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 \code{fcn}
as long as its inverse can be found in the namespace of the \pkg{compositions}
package. (That package need not be installed unless \code{fcn} is a character 
value.) For some such models, auto-detection process throws a
warning message, especially if \code{cbind} is also present in the model
formula.

Currently, no bias-adjustment option is available.
}
\examples{
if(requireNamespace("compositions"))
    emm_example("mvregrid")
    # Use emm_example("mvregrid", list = TRUE) # to see just the code

}
