libcoin/ 0000755 0001762 0000144 00000000000 13531167273 011701 5 ustar ligges users libcoin/NAMESPACE 0000644 0001762 0000144 00000000307 13207240763 013114 0 ustar ligges users
useDynLib(libcoin, .registration = TRUE)
importFrom("stats", complete.cases, vcov)
importFrom("mvtnorm", GenzBretz)
export(LinStatExpCov, doTest, ctabs, "lmult")
S3method("vcov", "LinStatExpCov")
libcoin/man/ 0000755 0001762 0000144 00000000000 13530705261 012446 5 ustar ligges users libcoin/man/LinStatExpCov.Rd 0000644 0001762 0000144 00000005561 13530705261 015447 0 ustar ligges users
\name{LinStatExpCov}
\alias{LinStatExpCov}
\alias{lmult}
\title{
Linear Statistics with Expectation and Covariance
}
\description{
Strasser-Weber type linear statistics and their expectation
and covariance under the independence hypothesis
}
\usage{
LinStatExpCov(X, Y, ix = NULL, iy = NULL, weights = integer(0),
subset = integer(0), block = integer(0), checkNAs = TRUE,
varonly = FALSE, nresample = 0, standardise = FALSE,
tol = sqrt(.Machine$double.eps))
lmult(x, object)
}
\arguments{
\item{X}{numeric matrix of transformations.}
\item{Y}{numeric matrix of influence functions.}
\item{ix}{an optional integer vector expanding \code{X}.}
\item{iy}{an optional integer vector expanding \code{Y}.}
\item{weights}{an optional integer vector of non-negative case weights.}
\item{subset}{an optional integer vector defining a subset of observations.}
\item{block}{an optional factor defining independent blocks of observations.}
\item{checkNAs}{a logical for switching off missing value checks. This
included switching off checks for suitable values of \code{subset}.
Use at your own risk.}
\item{varonly}{a logical asking for variances only.}
\item{nresample}{an integer defining the number of permuted statistics to draw.}
\item{standardise}{a logical asking to standardise the permuted statistics.}
\item{tol}{tolerance for zero variances.}
\item{x}{a contrast matrix to be left-multiplied in case \code{X} was a factor.}
\item{object}{an object of class \code{LinStatExpCov}.}
}
\details{
The function, after minimal preprocessing, calls the underlying C code
and computes the linear statistic, its expectation and covariance and,
optionally, \code{nresample} samples from its permutation distribution.
When both \code{ix} and \code{iy} are missing, the number of rows of
\code{X} and \code{Y} is the same, ie the number of observations.
When \code{X} is missing and \code{ix} a factor, the code proceeds as
if \code{X} were a dummy matrix of \code{ix} without explicitly
computing this matrix.
Both \code{ix} and \code{iy} being present means the code treats them
as subsetting vectors for \code{X} and \code{Y}. Note that \code{ix = 0}
or \code{iy = 0} means that the corresponding observation is missing
and the first row or \code{X} and \code{Y} must be zero.
\code{lmult} allows left-multiplication of a contrast matrix when \code{X}
was (equivalent to) a factor.
}
\value{
A list.
}
\references{
Strasser, H. and Weber, C. (1999). On the asymptotic theory of permutation
statistics. \emph{Mathematical Methods of Statistics} \bold{8}(2), 220--250.
}
\examples{
wilcox.test(Ozone ~ Month, data = airquality, subset = Month \%in\% c(5, 8))
aq <- subset(airquality, Month \%in\% c(5, 8))
X <- as.double(aq$Month == 5)
Y <- as.double(rank(aq$Ozone))
doTest(LinStatExpCov(X, Y))
}
\keyword{htest}
libcoin/man/ctabs.Rd 0000644 0001762 0000144 00000001704 13530705261 014033 0 ustar ligges users
\name{ctabs}
\alias{ctabs}
\title{
Cross Tabulation
}
\description{
Efficient weighted cross tabulation of two factors and a block
}
\usage{
ctabs(ix, iy = integer(0), block = integer(0), weights = integer(0),
subset = integer(0), checkNAs = TRUE)
}
\arguments{
\item{ix}{a integer of positive values with zero indicating a missing.}
\item{iy}{an optional integer of positive values with zero indicating a
missing.}
\item{block}{an optional blocking factor without missings.}
\item{weights}{an optional vector of weights, integer or double.}
\item{subset}{an optional integer vector indicating a subset.}
\item{checkNAs}{a logical for switching off missing value checks.}
}
\details{
A faster version of \code{xtabs(weights ~ ix + iy + block, subset)}.
}
\value{
If \code{block} is present, a three-way table. Otherwise,
a one- or two-dimensional table.
}
\examples{
ctabs(ix = 1:5, iy = 1:5, weights = 1:5 / 5)
}
\keyword{univar}
libcoin/man/doTest.Rd 0000644 0001762 0000144 00000003172 13530705261 014202 0 ustar ligges users
\name{doTest}
\alias{doTest}
\title{
Permutation Test
}
\description{
Perform permutation test for a linear statistic
}
\usage{
doTest(object, teststat = c("maximum", "quadratic", "scalar"),
alternative = c("two.sided", "less", "greater"), pvalue = TRUE,
lower = FALSE, log = FALSE, PermutedStatistics = FALSE,
minbucket = 10L, ordered = TRUE, maxselect = object$Xfactor,
pargs = GenzBretz())
}
\arguments{
\item{object}{an object returned by \code{\link{LinStatExpCov}}.}
\item{teststat}{type of test statistic to use.}
\item{alternative}{alternative for scalar or maximum-type statistics.}
\item{pvalue}{a logical indicating if a p-value shall be computed.}
\item{lower}{a logical indicating if a p-value (\code{lower} is \code{FALSE})
or 1 - p-value (\code{lower} is \code{TRUE}) shall be returned.}
\item{log}{a logical, if \code{TRUE} probabilities are log-probabilities.}
\item{PermutedStatistics}{a logical, return permuted test statistics.}
\item{minbucket}{minimum weight in either of two groups for maximally selected
statistics.}
\item{ordered}{a logical, if \code{TRUE} maximally selected statistics assume
that the cutpoints are ordered.}
\item{maxselect}{a logical, if \code{TRUE} maximally selected statistics are
computed. This requires that \code{X} was an implicitly defined design
matrix in \code{\link{LinStatExpCov}}.}
\item{pargs}{arguments as in \code{\link[mvtnorm:algorithms]{GenzBretz}}.}
}
\details{
Computes a test statistic, a corresponding p-value and, optionally, cutpoints
for maximally selected statistics.
}
\value{
A list.
}
\keyword{htest}
libcoin/DESCRIPTION 0000644 0001762 0000144 00000001510 13531167272 013403 0 ustar ligges users Package: libcoin
Title: Linear Test Statistics for Permutation Inference
Date: 2019-08-22
Version: 1.0-5
Authors@R: person("Torsten", "Hothorn", role = c("aut", "cre"),
email = "Torsten.Hothorn@R-project.org")
Description: Basic infrastructure for linear test statistics and permutation
inference in the framework of Strasser and Weber (1999) .
This package must not be used by end-users. CRAN package 'coin' implements all
user interfaces and is ready to be used by anyone.
Depends: R (>= 3.4.0)
Suggests: coin
Imports: stats, mvtnorm
LinkingTo: mvtnorm
NeedsCompilation: yes
License: GPL-2
Packaged: 2019-08-27 08:15:00 UTC; hothorn
Author: Torsten Hothorn [aut, cre]
Maintainer: Torsten Hothorn
Repository: CRAN
Date/Publication: 2019-08-27 08:50:02 UTC
libcoin/build/ 0000755 0001762 0000144 00000000000 13531163204 012766 5 ustar ligges users libcoin/build/vignette.rds 0000644 0001762 0000144 00000000377 13531163204 015334 0 ustar ligges users uPj0U.M|A~bPƠ>Mapx)S$::s !J#-2