https://github.com/cran/simPopulation
Raw File
Tip revision: 4b3459664d72206998e408f5d33f4ba48bb6e0d5 authored by Andreas Alfons on 13 July 2010, 00:00:00 UTC
version 0.1.3
Tip revision: 4b34596
tableWt.Rd
\name{tableWt}
\Rdversion{1.1}
\alias{tableWt}
\title{
  Weighted cross tabulation
}
\description{
  Compute contingency tables taking into account sample weights.
}
\usage{
tableWt(x, weights = NULL)
}
\arguments{
  \item{x}{a vector that can be interpreted as a factor, or a matrix or 
    \code{data.frame} whose columns can be interpreted as factors.}
  \item{weights}{an optional numeric vector containing sample weights.}
}
\details{
  For each combination of the variables in \code{x}, the weighted number of 
  occurence is computed as the sum of the corresponding sample weights.  If 
  weights are not specified, the function \code{\link{table}} is applied.
}
\value{
The (weighted) contingency table as an object of class \code{table}, an 
array of integer values.
}
\author{Stefan Kraft}
\seealso{\code{\link{table}}, \code{\link{contingencyWt}}}
\examples{
data(eusilcS)
tableWt(eusilcS[, c("hsize", "db040")], weights = eusilcS$rb050)
}
\keyword{category}
back to top