-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_test.Rd
71 lines (63 loc) · 2.06 KB
/
run_test.Rd
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
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/iDAS_functions.R
\name{run_test}
\alias{run_test}
\title{Run Either an ANOVA or Permutation-Based ANOVA Test}
\usage{
run_test(
data,
formula0,
formula1,
model_fit_function,
test_function,
n_perm = 1000,
BPPARAM = MulticoreParam()
)
}
\arguments{
\item{data}{A data frame containing the variables referenced in \code{formula0} and \code{formula1}.}
\item{formula0}{A formula specifying the reduced model.}
\item{formula1}{A formula specifying the full model.}
\item{model_fit_function}{A function used to fit the model (e.g. \code{lm}, \code{glm}, etc.).}
\item{test_function}{A character string specifying which test to run. Must be either
\code{"anova_test"} or \code{"perm_anova_test"}.}
\item{n_perm}{An integer specifying the number of permutations to use when
\code{test_function = "perm_anova_test"}. Default is \code{1000}.}
\item{BPPARAM}{An optional \code{\link[BiocParallel]{BiocParallelParam}} object for parallel computation.
Defaults to \code{\link[BiocParallel]{MulticoreParam}()}.}
}
\value{
The result object returned by either \code{\link{anova_test}} or
\code{\link{perm_anova_test}}, depending on \code{test_function}.
}
\description{
This function calls either \code{\link{anova_test}} or \code{\link{perm_anova_test}}
based on the specified \code{test_function}. If \code{test_function} is
\code{"anova_test"}, a standard ANOVA is performed. If \code{test_function} is
\code{"perm_anova_test"}, a permutation-based ANOVA is performed.
}
\examples{
\dontrun{
# Example using a linear model and standard ANOVA:
run_test(
data = mtcars,
formula0 = mpg ~ 1,
formula1 = mpg ~ cyl,
model_fit_function = "lm",
test_function = "anova_test"
)
# Example using a linear model and permutation-based ANOVA:
run_test(
data = mtcars,
formula0 = mpg ~ 1,
formula1 = mpg ~ cyl,
model_fit_function = "lm",
test_function = "perm_anova_test",
n_perm = 500
)
}
}
\seealso{
\code{\link{anova_test}}, \code{\link{perm_anova_test}}
}
\keyword{internal}