File: ace.test.Rd

package info (click to toggle)
acepack 1.6.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 256 kB
  • sloc: f90: 1,212; ansic: 32; makefile: 2
file content (87 lines) | stat: -rw-r--r-- 2,164 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/acetest.R
\name{acetest}
\alias{acetest}
\alias{summary.acetest}
\alias{print.acetest}
\alias{plot.acetest}
\title{ACE permutation test of independence}
\usage{
acetest(x, y = NULL, nperm = 999, ...)

\method{summary}{acetest}(object, ..., digits)

\method{print}{acetest}(x, ...)

\method{plot}{acetest}(
  x,
  acol = "blue",
  xlim = c(min(x$tp), max(c(x$tp, ceiling(x$ace * 10)/10))),
  col = "black",
  breaks = 100,
  main = "ACE Correlation Permutations",
  xlab = bquote(rho(.(x$xname), .(x$yname))),
  lwd = 2,
  ...
)
}
\arguments{
\item{x}{a numeric vector, or a matrix or data frame with two columns. The
first column is the 'y' and the second column is the 'x' when
calling \code{\link{ace}}.}

\item{y}{a vector with same length as x. Default is NULL.}

\item{nperm}{number of permutations. Default is 999.}

\item{...}{additional arguments to pass to \code{cor}.}

\item{object}{S3 object of test results to dispatch.}

\item{digits}{Number of significant digits to round for summary.}

\item{acol}{for plot; color of the point estimate of correlation}

\item{xlim}{for plot;xlimit of histogram}

\item{col}{for plot;color of histogram bars}

\item{breaks}{for plot;number of breaks. Default to 100.}

\item{main}{for plot; main title of plot}

\item{xlab}{for plot; x-axis label}

\item{lwd}{for plot; line width of point estimate}
}
\value{
a list containing the following:
\itemize{
  \item{\code{ace}} The value of the test statistic.
  \item{\code{pval}} The *p*-value of the test.
}
}
\description{
Performs a permutation test of independence or association. The
  alternative hypothesis is that x and y are dependent. 
  
Code authored by Bernhard Klar, Shawn Garbett.
}
\examples{

n <- 200
z <- matrix(rnorm(2*n), n) / sqrt(rchisq(n, 2)/2)
x <- z[,2]; y <- z[,1]
cor.test(x, y, method="spearman")
acetest(x, y)

plot(acetest(z))
}
\references{
Holzmann, H., Klar, B. 2025. "Lancaster correlation - a new dependence measure
linked to maximum correlation". Scandinavian Journal of Statistics.
52(1):145-169 <doi:10.1111/sjos.12733>
}
\seealso{
\code{\link{cor}}
}