swh:1:snp:33a53053e50f7abe7d281cc0c803be827debf4a3
Tip revision: 8cebb2a86b2cc68f621a88dbb070be4bb968f6bc authored by Edzer J. Pebesma on 15 March 2007, 00:00:00 UTC
version 0.9-38
version 0.9-38
Tip revision: 8cebb2a
get.contr.Rd
% $Id: get.contr.Rd,v 1.4 2006-02-10 19:03:27 edzer Exp $
\name{get.contr}
\alias{get.contr}
\title{ Calculate contrasts from multivariable predictions }
\description{ Given multivariable predictions and prediction (co)variances,
calculate contrasts and their (co)variance }
\usage{ get.contr(data, gstat.object, X, ids = names(gstat.object$data)) }
\arguments{
\item{data}{data frame, output of \link{predict.gstat} }
\item{gstat.object}{object of class \code{gstat}, used to
extract ids; may be missing if \code{ids} is used }
\item{X}{ contrast vector or matrix; the number of variables in
\code{gstat.object} should equal the number of elements in \code{X}
if \code{X} is a vector, or the number of rows in \code{X} if \code{X}
is a matrix. }
\item{ids}{ character vector with (selection of) id names, present in data }
}
\details{
From data, we can extract the $(n \times 1)$ vector with multivariable
predictions, say $y$, and its $(n \times n)$ covariance matrix $V$. Given
a contrast matrix in $X$, this function computes the contrast vector is
$C=X'y$ and $Var(C)=X'V X$.
}
\value{
a data frame containing for each row in \code{data} the generalized
least squares estimates (named beta.1, beta.2, ...), their
variances (named var.beta.1, var.beta.2, ...) and covariances
(named cov.beta.1.2, cov.beta.1.3, ...)
}
\references{
\url{http://www.gstat.org/}
}
\author{ Edzer J. Pebesma }
\note{ }
\seealso{\link{predict.gstat}}
\examples{
}
\keyword{ models }